UD2

UD2
Page d'aide sur l'homonymie Pour les articles homonymes, voir UD et 2 (nombre).

En langage assembleur x86, l'instruction UD2 est un mnémonique pour Undefined instruction (traduction : Instruction non définie).

Sommaire

Description

L'instruction UD2 produit un opcode invalide, c'est-à-dire, qu'elle mime exactement le même processus dans le cas où le processeur rencontrerait un opcode qu'il ne connaît pas. Cette instruction est à réserver à des fins de tests uniquement, afin de générer spécifiquement et uniquement une erreur d'opcode invalide. C'est le seul et unique but de cette instruction.

Drapeaux affectés

Aucun drapeau n'est affecté.

Exceptions générées

UD2 produit une exception de type UD (Undefined opcode, vecteur d'interruption numéro 6) et ce pour les trois modes d'opérations (Mode réel, Mode virtuel 8086, Mode protégé).

Exemple d'utilisation

Langages C ou C++

  • Microsoft Visual C++ (code non portable)
#include <windows.h>
#include <iostream>
 
bool __ud2(void)
{
        __try{
                __asm{UD2}
        }
    __except(GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION ? 
             EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
        {
                return true;
        }
        return false;
 }
 
int main(void)
{
        if ( __ud2() )
                std::cout << "Exception d'opcode invalide rencontrée";
        else 
                std::cout << "Exception d'opcode invalide non rencontrée";
 
        return 0;
}

Articles connexes


Wikimedia Foundation. 2010.

Contenu soumis à la licence CC-BY-SA. Source : Article UD2 de Wikipédia en français (auteurs)

Игры ⚽ Поможем сделать НИР

Regardez d'autres dictionnaires:

  • UD-2 — UD2 Pour les articles homonymes, voir UD et 2 (nombre). En langage assembleur x86 , l instruction UD2 est un mnémonique pour Undefined instruction (traduction : Instruction non définie). L instruction fut ajoutée au processeur Pentium Pro.… …   Wikipédia en Français

  • UD 2 — UD2 Pour les articles homonymes, voir UD et 2 (nombre). En langage assembleur x86 , l instruction UD2 est un mnémonique pour Undefined instruction (traduction : Instruction non définie). L instruction fut ajoutée au processeur Pentium Pro.… …   Wikipédia en Français

  • Lockheed P-3 Orion variants — Lockheed EP 3 ARIES. The following is an extensive catalogue of the variants and specific unique elements of each variant and/or design stage of the Lockheed P 3 Orion maritime surveillance aircraft. For a broader article on the history of the P… …   Wikipedia

  • P-3 Orion — infobox Aircraft name = P 3 Orion caption = U.S. Navy P 3C Orion assigned to VP 22 type = Maritime patrol aircraft national origin = United States manufacturer = Lockheed designer = first flight = 25 November 1959 introduction = 1962 status =… …   Wikipedia

  • 8900 AAVSO — Infobox Planet minorplanet = yes width = 25em bgcolour = #FFFFC0 apsis = name = AAVSO symbol = caption = discovery = yes discovery ref = discoverer = D. di Cicco discovery site = Sudbury, Massachusetts discovered = October 24, 1995 designations …   Wikipedia

  • 9153 Chikurinji — Infobox Planet minorplanet = yes width = 25em bgcolour = #FFFFC0 apsis = name = Chikurinji symbol = caption = discovery = yes discovery ref = discoverer = H. Kosai and K. Hurukawa discovery site = Kiso Station of the Tokyo Astronomical… …   Wikipedia

  • 2398 Jilin — Infobox Planet minorplanet = yes width = 25em bgcolour = #FFFFC0 apsis = name = Jilin symbol = caption = discovery = yes discovery ref = discoverer = Purple Mountain Observatory discovery site = Nanking discovered = October 24, 1965 designations …   Wikipedia

  • 4562 Poleungkuk — Infobox Planet minorplanet = yes width = 25em bgcolour = #FFFFC0 apsis = name = Poleungkuk symbol = caption = discovery = yes discovery ref = discoverer = discovery site = discovered = , designations = yes mp name = 4562 alt names = 1979 UD2 mp… …   Wikipedia

  • Intel 80186 — Infobox Computer Hardware Cpu name = Intel 80186 caption = An Intel 80186 Microprocessor produced start = 1982 produced end = present (the CMOS version) slowest = 6| slow unit = MHz fastest = 12 | fast unit = MHz manuf1 = Intel arch = x86 16… …   Wikipedia

  • X86 instruction listings — The x86 instruction set has undergone numerous changes over time. Most of them were to add new functionality to the instruction set.x86 integer instructionsThis is the full 8086/8088 instruction set, but most, if not all of these instructions are …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”