Assembly Programoz S

Total Page:16

File Type:pdf, Size:1020Kb

Assembly Programoz S ASSEMBLY PROGRAMOZÁS AJÁNLOTT IRODALOM 1)Pethő Ádám: Assembly alapismeretek 1. kötet, Számalk, Budapest, 1992 2)Peter Norton-John Socha: Az IBM PC Assembly nyelvű programozása, Novotrade, Budapest, 1991 3)Peter Norton: Az IBM PC programozása, Műszaki Könyvkiadó, Budapest, 1992 4)László József: A VGA-kártya programozása Pascal és Assembly nyelven, ComputerBooks, Budapest, 1994 5)Abonyi Zsolt: PC hardver kézikönyv 6)Dr. Kovács Magda: 32 bites mikroprocesszorok 80386/80486 I. és II. kötet, LSI, Budapest 1 TARTALOM 1 AZ ASSEMBLY NYELV TULAJDONSÁGAI, JELENTŐSÉGE. 9 2 A PC-K HARDVERÉNEK FELÉPÍTÉSE.................................13 3 SZÁMRENDSZEREK, GÉPI ADATÁBRÁZOLÁS, ARITMETIKA ÉS LOGIKA.......................................................... 16 4 A 8086-OS PROCESSZOR JELLEMZŐI, SZOLGÁLTATÁSAI. 24 4.1 Memóriakezelés.........................................................................25 4.2 Regiszterek................................................................................ 26 4.3 Adattípusok................................................................................30 4.4 Memóriahivatkozások, címzési módok..................................... 31 4.4.1 Közvetlen címzés................................................................................................ 31 4.4.2 Báziscímzés.........................................................................................................31 4.4.3 Indexcímzés.........................................................................................................32 4.4.4 Bázis+relatív címzés........................................................................................... 32 4.4.5 Index+relatív címzés...........................................................................................32 4.4.6 Bázis+index címzés.............................................................................................32 4.4.7 Bázis+index+relatív címzés................................................................................33 4.5 Veremkezelés.............................................................................34 4.6 I/O, megszakítás-rendszer......................................................... 38 5 AZ ASSEMBLY NYELV SZERKEZETE, SZINTAXISA.........39 6 A 8086-OS PROCESSZOR UTASÍTÁSKÉSZLETE.................46 6.1 Prefixek......................................................................................47 6.1.1 Szegmensfelülbíráló prefixek............................................................................. 47 6.1.2 Buszlezáró prefix................................................................................................ 47 6.1.3 Sztringutasítást ismétlő prefixek.........................................................................47 6.2 Utasítások.................................................................................. 48 6.2.1 Adatmozgató utasítások......................................................................................48 6.2.2 Egész számos aritmetika..................................................................................... 49 6.2.3 Bitenkénti logikai utasítások (Boole-műveletek)............................................... 49 6.2.4 Bitléptető utasítások............................................................................................49 6.2.5 Sztringkezelő utasítások..................................................................................... 50 2 6.2.6 Binárisan kódolt decimális (BCD) aritmetika.................................................... 50 6.2.7 Vezérlésátadó utasítások.....................................................................................50 6.2.8 Rendszervezérlő utasítások.................................................................................51 6.2.9 Koprocesszor-vezérlő utasítások........................................................................ 51 6.2.10 Speciális utasítások...........................................................................................51 7 VEZÉRLÉSI SZERKEZETEK MEGVALÓSÍTÁSA................ 53 7.1 Szekvenciális vezérlési szerkezet.............................................. 55 7.2 Számlálásos ismétléses vezérlés................................................60 7.3 Egyszerű és többszörös szelekciós vezérlés.............................. 65 7.4 Eljárásvezérlés........................................................................... 73 8 A TURBO DEBUGGER HASZNÁLATA.................................. 79 9 SZÁMOLÁS ELŐJELES SZÁMOKKAL, BITMŰVELETEK. 84 9.1 Matematikai kifejezések kiértékelése........................................84 9.2 Bitforgató utasítások..................................................................89 9.3 Bitmanipuláló utasítások........................................................... 93 10 AZ ASSEMBLY NYELV KAPCSOLATA MAGAS SZINTŰ NYELVEKKEL, PARAMÉTERÁTADÁS FORMÁI....................97 10.1 Paraméterek átadása regisztereken keresztül...........................97 10.2 Paraméterek átadása globális változókon keresztül................ 99 10.3 Paraméterek átadása a vermen keresztül............................... 102 10.4 Lokális változók megvalósítása.............................................107 11 MŰVELETEK SZTRINGEKKEL.......................................... 109 12 AZ .EXE ÉS A .COM PROGRAMOK KÖZÖTTI KÜLÖNBSÉGEK, A PSP.............................................................118 12.1 A DOS memóriakezelése.......................................................118 12.2 Általában egy programról......................................................121 12.3 Ahogy a DOS indítja a programokat..................................... 124 12.4 .COM állományok................................................................. 127 12.5 Relokáció............................................................................... 129 12.6 .EXE állományok...................................................................133 13 SZOFTVER-MEGSZAKÍTÁSOK...........................................135 13.1 Szövegkiíratás, billentyűzet-kezelés......................................137 3 13.2 Szöveges képernyő kezelése, számok hexadecimális alakban kiírása.............................................................................................140 13.3 Munka állományokkal........................................................... 146 13.4 Grafikus funkciók használata................................................ 150 14 MEGSZAKÍTÁS-ÁTDEFINIÁLÁS, HARDVER- MEGSZAKÍTÁSOK, REZIDENS PROGRAM, KAPCSOLAT A PERIFÉRIÁKKAL, HARDVER-PROGRAMOZÁS.................. 154 14.1 Szoftver-megszakítás átirányítása......................................... 156 14.2 Az időzítő (timer) programozása...........................................163 14.3 Rezidens program (TSR) készítése, a szöveges képernyő közvetlen elérése............................................................................170 15 KIVÉTELEK............................................................................174 16 OPTIMALIZÁLÁS MÓDJAI................................................. 178 16.1 Sebességre optimalizálás....................................................... 178 16.2 Méretre optimalizálás............................................................ 184 17 ÚJABB ARCHITEKTÚRÁK.................................................. 188 17.1 Dokumentálatlan lehetőségek................................................204 17.2 A numerikus koprocesszor szolgáltatásai..............................218 17.2.1 Adatmozgató utasítások..................................................................................233 17.2.2 Alap aritmetikai utasítások............................................................................. 235 17.2.3 Összehasonlító utasítások............................................................................... 239 17.2.4 Transzcendentális utasítások.......................................................................... 242 17.2.5 Konstansbetöltő utasítások............................................................................. 245 17.2.6 Koprocesszor-vezérlő utasítások.................................................................... 245 17.3 Az Intel 80186-os processzor újdonságai..............................253 17.3.1 Változások az utasításkészletben....................................................................253 17.3.2 Új utasítások....................................................................................................255 17.3.3 Új kivételek.....................................................................................................258 17.4 Az Intel 80286-os processzoron megjelent új szolgáltatások...... 259 17.4.1 Változások az utasításkészletben....................................................................259 17.4.2 Új prefixek...................................................................................................... 260 17.4.3 Új utasítások....................................................................................................261 17.4.4 Új üzemmódok................................................................................................264 17.4.5 Változások a kivétel-kezelésben.....................................................................266 17.4.6 Új kivételek.....................................................................................................267 4 17.4.7 Változások a regiszterkészletben....................................................................273 17.4.8 Új regiszterek.................................................................................................
Recommended publications
  • Automatic Extraction of X86 Formal Semantics from Its Natural Language Description
    Automatic extraction of x86 formal semantics from its natural language description NGUYEN, Lam Hoang Yen Graduate School of Advanced Science and Technology Japan Advanced Institute of Science and Technology March, 2018 Master's Thesis Automatic extraction of x86 formal semantics from its natural language description 1610062 NGUYEN, Lam Hoang Yen Supervisor : Professor Mizuhito Ogawa Main Examiner : Professor Mizuhito Ogawa Examiners : Associate Professor Nguyen Minh Le Professor Kazuhiro Ogata Associate Professor Nao Hirokawa Graduate School of Advanced Science and Technology Japan Advanced Institute of Science and Technology [Information Science] February, 2018 Abstract Nowadays, computers have become an essential device of almost every activity for every- body at any age. From personal demands to industrial and business sectors, they are used to improve human life as well as the efficiency and the productivity. The more important they are, the more attractive target they become for being attacked and serving malicious purposes. There are various threats to a computer system. One of the most common manners that penetrates or damages a system with bad impacts to most of the computer users is malware. Malware detection and malware classification are two of the most at- tractive problems in not only industry area but also academic research. The bits-based fingerprint also known as the signature-based pattern recognition is applied popularly in commercial anti-virus software due to its light-weight and fast features. However, it is easily cheated by advanced polymorphic techniques in malware. Therefore, malware analyses based on control flow graph (CFG) have been attracting a lot of attention, e.g., VxClass at Google.
    [Show full text]
  • Lecture Notes in Assembly Language
    Lecture Notes in Assembly Language Short introduction to low-level programming Piotr Fulmański Łódź, 12 czerwca 2015 Spis treści Spis treści iii 1 Before we begin1 1.1 Simple assembler.................................... 1 1.1.1 Excercise 1 ................................... 2 1.1.2 Excercise 2 ................................... 3 1.1.3 Excercise 3 ................................... 3 1.1.4 Excercise 4 ................................... 5 1.1.5 Excercise 5 ................................... 6 1.2 Improvements, part I: addressing........................... 8 1.2.1 Excercise 6 ................................... 11 1.3 Improvements, part II: indirect addressing...................... 11 1.4 Improvements, part III: labels............................. 18 1.4.1 Excercise 7: find substring in a string .................... 19 1.4.2 Excercise 8: improved polynomial....................... 21 1.5 Improvements, part IV: flag register ......................... 23 1.6 Improvements, part V: the stack ........................... 24 1.6.1 Excercise 12................................... 26 1.7 Improvements, part VI – function stack frame.................... 29 1.8 Finall excercises..................................... 34 1.8.1 Excercise 13................................... 34 1.8.2 Excercise 14................................... 34 1.8.3 Excercise 15................................... 34 1.8.4 Excercise 16................................... 34 iii iv SPIS TREŚCI 1.8.5 Excercise 17................................... 34 2 First program 37 2.1 Compiling,
    [Show full text]
  • Semiconductor Contract Manufacturing Services Worldwide, 1998-1999
    Perspective Semiconductor Contract Manufacturing Services Worldwide Market Analysis Semiconductor Contract IVIanufacturing Wafer Pricing Trends: October 1998 Abstract: in the third of three surveys of semiconductor contract manufacturing wafer prices conducted in 1998, Dataquest observes continuing price declines. Prices are reported for 150mm and 200mm wafers, categorized by minimum feature size and number of metal interconnect levels, as well as special process options. Results are compared with those of previous surveys dating back almost three years. Finally, a consensus view of short-term price projections is presented and discussed in relation to current supply and demand dynamics within the semiconductor foundry market. By James F. Hines Foundry Wafer Prices: More Deciines, but Some Firming at the Lagging Edge Fovindry-processed wafer prices declined in leading-edge technology categories and increased in some of the more mature technologies in the J period from June to October 1998. The current results of Dataquest's survey Lii of semiconductor contract manufachiring (SCM) wafer prices mark two years D of pricing pressure as the industry struggles under a stubborn oversupply N condition. Survey results include the following: Z UJ • Average prices for ISOmtn wafers ranged from $498 to $623, compared > _J with $449 to $650 in June 1998. CL < > • Prices for 200mm wafers, which generally represent the leading-edge technologies, averaged $870 to $2,241, compared with $917 to $2,611 in O < June 1998. oLU ^ < • Average prices for 0.25-micron
    [Show full text]
  • Evolution Des X86befehlssatzes Und Seiner Erweiterungen
    Technische Universität Dresden Evolution des x86-Befehlssatzes und seiner Erweiterungen Peter Ebert Dresden, 15.07.2009 Einführung · Überblick & Historie · Konkurrierende Befehlssatzarchitekture n · Befehlsarten · Registerstruktur · x87 15.07.2009 Evolution des x86-Befehlssatzes und seiner Erweiterungen 2/24 Übersicht & Historie · IBM 1981: erster PC · x86-Architektur verwendet einen CISC-Befehlssatz · alle Prozessoren seit dem Pentium Pro sind aber hybride CISC/RISC-Prozessoren 1978 1. Gen.: 8086 1982 2. Gen.: 80286 1985 3. Gen.: 80386 IA-32 1989 4. Gen.: 80486 1993 5. Gen.: Pentium MMX 1995 6. Gen.: P2, P3 3DNow!, SSE 1999 7. Gen.: Athlon (XP), P4 SSE2 2003 8. Gen.: Opteron x86-64 15.07.2009 Evolution des x86-Befehlssatzes und seiner Erweiterungen 3/24 Konkurrierende Befehlssatzarchitekturen · ARM (Acorn Risc Machine) RISC-Architektur 1983 vom englischen Computerhersteller Acorn. Einsatz vor allem im eingebetteten Bereich z.B.: Mobiltelefonen, PDAs, Routern, iPod, iPhone, Internet Tablets von Nokia und den neueren PDAs von ASUS, Konsolen wie der Nintendo DS, der GP2X und die Pandora. · PowerPC (Performance optimization with enhanced RISC Performance Chip) 1991 durch ein Konsortium aus Apple, IBM und Motorola. z.B.: Nintendo GameCube und Wii, Xbox 360 von Microsoft, Playstation 3 von Sony und in vielen eingebetteten Systemen. Auch benutzen PKW und Produkte in der Luft- und Raumfahrt · SPARC (Scalable Processor ARChitecture) Von Sun Microsystems entwickelt ab 1985 und vermarktete ab 1987, offene Architektur, 1995 64-Bit-Erweiterung (UltraSparc) 15.07.2009 Evolution des x86-Befehlssatzes und seiner Erweiterungen 4/24 Befehlsarten · Transferbefehlen werden Daten innerhalb des Systems bewegt. Die Daten werden dabei nur kopiert, d. h. bleiben an ihrem Quellort unverändert.
    [Show full text]
  • 17Computerarchitectu
    Computer Architecture and Assembly Language Prof. David August COS 217 1 Goals of Today’s Lecture • Computer architecture o Central processing unit (CPU) o Fetch-decode-execute cycle o Memory hierarchy, and other optimization • Assembly language o Machine vs. assembly vs. high-level languages o Motivation for learning assembly language o Intel Architecture (IA32) assembly language 2 Levels of Languages • Machine language o What the computer sees and deals with o Every command is a sequence of one or more numbers • Assembly language o Command numbers replaced by letter sequences that are easier to read o Still have to work with the specifics of the machine itself • High-level language o Make programming easier by describing operations in a natural language o A single command replaces a group of low-level assembly language commands 3 Why Learn Assembly Language? • Understand how things work underneath o Learn the basic organization of the underlying machine o Learn how the computer actually runs a program o Design better computers in the future • Write faster code (even in high-level language) o By understanding which high-level constructs are better o … in terms of how efficient they are at the machine level • Some software is still written in assembly language o Code that really needs to run quickly o Code for embedded systems, network processors, etc. 4 A Typical Computer CPU . CPU Memory Chipset I/O bus ROM Network 5 Von Neumann Architecture • Central Processing Unit CPU o Control unit Control – Fetch, decode, and execute Unit o Arithmetic
    [Show full text]
  • Computer Architectures an Overview
    Computer Architectures An Overview PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 25 Feb 2012 22:35:32 UTC Contents Articles Microarchitecture 1 x86 7 PowerPC 23 IBM POWER 33 MIPS architecture 39 SPARC 57 ARM architecture 65 DEC Alpha 80 AlphaStation 92 AlphaServer 95 Very long instruction word 103 Instruction-level parallelism 107 Explicitly parallel instruction computing 108 References Article Sources and Contributors 111 Image Sources, Licenses and Contributors 113 Article Licenses License 114 Microarchitecture 1 Microarchitecture In computer engineering, microarchitecture (sometimes abbreviated to µarch or uarch), also called computer organization, is the way a given instruction set architecture (ISA) is implemented on a processor. A given ISA may be implemented with different microarchitectures.[1] Implementations might vary due to different goals of a given design or due to shifts in technology.[2] Computer architecture is the combination of microarchitecture and instruction set design. Relation to instruction set architecture The ISA is roughly the same as the programming model of a processor as seen by an assembly language programmer or compiler writer. The ISA includes the execution model, processor registers, address and data formats among other things. The Intel Core microarchitecture microarchitecture includes the constituent parts of the processor and how these interconnect and interoperate to implement the ISA. The microarchitecture of a machine is usually represented as (more or less detailed) diagrams that describe the interconnections of the various microarchitectural elements of the machine, which may be everything from single gates and registers, to complete arithmetic logic units (ALU)s and even larger elements.
    [Show full text]
  • Intel Architecture Intel Architecture
    CS499 Intel Architecture Intel Architecture References IA-32 Intel® Architecture Software Developer’s Manual, • Volume 1: Basic Architecture • Volume 2: Instruction Set Reference www.intel.com/design/pentiumii/manuals/ Number Systems Decimal-to-Hexadecimal: 420.62510 = 420.62510 = 42010 + .62510 Division Quotient Remainder 420 ÷ 16 26 4 LSB 26 ÷ 16 1 10 (or A) 1 ÷ 16 0 1 MSB Multiplication Product Carry-out .625 x 16 10.00 10 (or A) 420.62510 = 1A4.A16 413510 = 102716 625.62510 = 271.A16 Number Systems Binary-Coded Hexadecimal (BCH): 2AC = 0010 1010 1100 1000 0011 1101 . 1110 = 83D.E Complements Data are stored in complement form to represent negative numbers One’s complements of 01001100 1111 1111 -0100 1100 1011 0011 Two’s complements 1011 0011 +0000 0001 1011 0100 The 80x86 MICROPROCESSOR Some buzz words ...ha? CISC – Complex Instruction Set Computers • Refers to number and complexity of instructions • Improvements was: Multiply and Divide • The number of instruction increased from • 45 on 4004 to: • 246 on 8085 • 20,000 on 8086 and 8088 RISC – Reduced Instruction Set Computer • Executes one instruction per clock Newer RISC - Superscaler Technology • Execute more than one instruction per clock Inside The 8088/8086 Concepts important to the internal operation of 8088/8086 • Pipelining • Registers Inside The 8088/8086…pipelining • Pipelining – Two ways to make CPU process information faster: • Increase the working frequency – technology dependent • Change the internal architecture of the CPU – Pipelining is to allow CPU to fetch and
    [Show full text]
  • (Mentos) Fundamental Concepts
    Mentoring Operating System (MentOS) fundamental concepts Alessandro Danese University of Verona [email protected] Version 1.0.0 Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 1 / 23 Table of Contents 1 Mentoring Operating System 2 Fundamental concepts Central Processing Unit (CPU) Programmable Interrupt Controller (PIC) Memory organization 3 Kernel doubly-linked list Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 2 / 23 Mentoring Operating System Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 3 / 23 MentOS What... MentOS (Mentoring Operating system) is an open source educational operating system. MentOS can be freely downloaded from a public github repository: https://mentos-team.github.io/MentOS/ Goal... The goal of MentOS is to provide a project environment that is realistic enough to show how a real Operating System work, yet simple enough that students can understand and modify it in significant ways. Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 4 / 23 MentOS Why... There are so many operating systems, why did we write MentOs? It is true, there are a lot of education operating system, BUT how many of them follow the guideline defined by Linux? MentOs aims to have the same Linux's data structures and algorithms. It has a well-documented source code, and you can compile it on your laptop in a few seconds! If you are a beginner in Operating-System developing, perhaps MentOS is the right operating system to start with. Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 5 / 23 Fundamental concepts Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 6 / 23 The big picture Central Processing Unit Programmable Interrupt Controller Random Access Memory RAM PIC CPU BUS (Address, Data, Control) Mentoring Operating System (MentOS) fundamental concepts Version 1.0.0 7 / 23 CPU registers There are three types of registers: general-purpose data registers, segment registers, and status control registers.
    [Show full text]
  • Chapter 3 Basic Execution Environment
    CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel 64 or IA-32 processor as seen by assembly- language programmers. It describes how the processor executes instructions and how it stores and manipulates data. The execution environment described here includes memory (the address space), general-purpose data registers, segment registers, the flag register, and the instruction pointer register. 3.1 MODES OF OPERATION The IA-32 architecture supports three basic operating modes: protected mode, real-address mode, and system management mode. The operating mode determines which instructions and architectural features are accessible: • Protected mode — This mode is the native state of the processor. Among the capabilities of protected mode is the ability to directly execute “real-address mode” 8086 software in a protected, multi-tasking environment. This feature is called virtual-8086 mode, although it is not actually a processor mode. Virtual-8086 mode is actually a protected mode attribute that can be enabled for any task. • Real-address mode — This mode implements the programming environment of the Intel 8086 processor with extensions (such as the ability to switch to protected or system management mode). The processor is placed in real-address mode following power-up or a reset. • System management mode (SMM) — This mode provides an operating system or executive with a transparent mechanism for implementing platform-specific functions such as power management and system security. The processor enters SMM when the external SMM interrupt pin (SMI#) is activated or an SMI is received from the advanced programmable interrupt controller (API C). In SMM, the processor switches to a separate address space while saving the basic context of the currently running program or task.
    [Show full text]
  • Status Flags
    BASIC EXECUTION ENVIRONMENT 3.4.3.1. STATUS FLAGS The status flags (bits 0, 2, 4, 6, 7, and 11) of the EFLAGS register indicate the results of arith- metic instructions, such as the ADD, SUB, MUL, and DIV instructions. The functions of the status flags are as follows: CF (bit 0) Carry flag. Set if an arithmetic operation generates a carry or a borrow out of the most-significant bit of the result; cleared otherwise. This flag indi- cates an overflow condition for unsigned-integer arithmetic. It is also used in multiple-precision arithmetic. PF (bit 2) Parity flag. Set if the least-significant byte of the result contains an even number of 1 bits; cleared otherwise. AF (bit 4) Adjust flag. Set if an arithmetic operation generates a carry or a borrow out of bit 3 of the result; cleared otherwise. This flag is used in binary- coded decimal (BCD) arithmetic. ZF (bit 6) Zero flag. Set if the result is zero; cleared otherwise. SF (bit 7) Sign flag. Set equal to the most-significant bit of the result, which is the sign bit of a signed integer. (0 indicates a positive value and 1 indicates a negative value.) OF (bit 11) Overflow flag. Set if the integer result is too large a positive number or too small a negative number (excluding the sign-bit) to fit in the destina- tion operand; cleared otherwise. This flag indicates an overflow condition for signed-integer (two’s complement) arithmetic. Of these status flags, only the CF flag can be modified directly, using the STC, CLC, and CMC instructions.
    [Show full text]
  • Hardware Assisted Arithmetic Overflow Detection
    A Proposal for Hardware-Assisted Arithmetic Overflow Detection for Array and Bitfield Operations Darek Mihocka Jens Troeger Intel Corp. Intel Corp. [email protected] [email protected] An additional problem for either the traditional arithmetic Abstract flags or SIMD based overflow detection mechanisms is that they cannot operate on small or unconventional data sizes. The Intel Larrabee4 SIMD instruction set for example, only Detecting arithmetic overflow during summation operations supports packed 32-bit and 64-bit integer types, and is vital to ensuring correct and secure behavior of many therefore cannot operate on 8-bit or 16-bit integers directly types of code. For example, applying transformations to without additional data conversion operations. signed integer pixel co-ordinates without any overflow detection may result in pixels rendering at unexpected Neither approach can operate directly on bitfield data types negative co-ordinates, summing a large array of signed or such as the common 5-6-5 packing of RGB pixel values, or unsigned integers without overflow detection can result in something even more trivial such as incrementing a 4-bit bogus totals, or performing arithmetic operations on packed bitfield, since the smallest arithmetic flags generating bitfields without overflow detection could result in operations on most processors require data elements at least corruption of data in adjacent bitfields. 8 bits wide. A traditional way to detect arithmetic overflow is to insert This paper examines an alternative and purely integer-based specific checks of the host processor’s Overflow arithmetic “lazy flags”5 method of detecting signed and unsigned condition flag after each arithmetic operation to detect arithmetic overflow conditions which decouples the signed integer overflow, or a check of the host processor’s generation of the sums (or differences) from the detection Carry arithmetic flag to detect unsigned integer overflow.
    [Show full text]
  • FLAGS Register (Computing) - Wikipedia, the Free Encyclopedia Page 1 of 3
    FLAGS register (computing) - Wikipedia, the free encyclopedia Page 1 of 3 FLAGS register (computing) From Wikipedia, the free encyclopedia This article discusses the flag register specific to the x86 architecture. For a general discussion about flag registers, see status register. The FLAGS register is the status register in Intel x86 microprocessors that contains the current state of the processor. This register is 16 bits wide. Its successors, the EFLAGS and RFLAGS registers are 32 bits and 64 bits wide, respectively. The wider registers retain compatibility with their smaller predecessors. Intel x86 FLAGS Register Bit # Abbreviation Description Category [1] FLAGS 0 CF Carry flag S 1 1 Reserved 2 PF Parity flag S 3 0 Reserved 4 AF Adjust flag S 5 0 Reserved 6 ZF Zero flag S 7 SF Sign flag S 8 TF Trap flag (single step) X 9 IF Interrupt enable flag X 10 DF Direction flag C 11 OF Overflow flag S 12, 13 IOPL I/O privilege level (286+ only) X 14 NT Nested task flag (286+ only) X 15 0 Reserved EFLAGS 16 RF Resume flag (386+ only) X 17 VM Virtual 8086 mode flag (386+ only) X 18 AC Alignment check (486SX+ only) X 19 VIF Virtual interrupt flag (Pentium+) X 20 VIP Virtual interrupt pending (Pentium+) X 21 ID Identification (Pentium+) X 22 0 Reserved http://en.wikipedia.org/wiki/FLAGS_register_(computing) 9/22/2010 FLAGS register (computing) - Wikipedia, the free encyclopedia Page 2 of 3 23 0 Reserved 24 0 Reserved 25 0 Reserved 26 0 Reserved 27 0 Reserved 28 0 Reserved 29 0 Reserved 30 0 Reserved 31 0 Reserved RFLAGS 32-63 0 Reserved 1.
    [Show full text]