Of it during addition, or a borrow into it during subtraction. The Auxiliary Flag ( af bit 4) is only set when bit 3 ( regardless of the operand size) of the result has a carry out The Zero Flag ( zf bit 6) is setonly when all bits of the result are zero otherwise, it's reset. SF will only be set if there is a 1 in bit 7, 15 or 31 thus it has the same state as the result's high-order bit. The Sign Flag ( sf bit 7) is setonly when the high-order bit of a result is set. So for an 8-, 16- or 32-bit operation, OF will only be set if there was an overflow at bit 7, 15 or 31 for the respective operation (remember, The Overflow Flag ( of bit 11) is setwhen an operation results in a signed overflow which occurs when there'sĪ carry/borrow into but not out of the high-order bit, or vice-versa ( out of but not into). However, the following flags require a detailed explanation: The Direction (bit 10 Set= Down, 0= Up) and Interrupt (bit 9 Set= Enabled,Ġ= Disabled) Flags are somewhat obvious. Note: The word set means a bit is set to 1, whereas the words reset or
NG = NeGative, PL = PLus a strange mixing of terms due to theįact that 'Odd Parity' is represented by PO (so it can'tīe as POsitive here), but they still could have used 'MI'Īnd for the word, MInus instead of 'NeGative'.ĪC = Auxiliary Carry, NA = Not Auxiliary carry. DN = DowN, UP (up).ĮI = Enable Interupt, DI = Disable Interupt. The individual abbreviations appear to have these meanings: Interrupt if = EI (enabled) DI (disabled) Overflow of = OV (OVerflow) NV ĭirection df = DN (decrement) UP (increment) Of the eight "Flags" which are to be interpreted as follows: This is an 8-bit register that holds 1-bit of data for each Use an abbreviation for the Name of the Flag and simply show whether it's a 0 or 1 bit.) Newer 32-bit debuggers, such as Borland's Turbo Debugger, display the same eight Flags as DEBUG, but Make sure you study the final table below if you'll be reading textbooks which discuss the newer 16-bit Flags Register. Of Assembly programs, then I advise you to copy these abbreviations onto notecards and try to understand why certainīits (flags) do/don't change in the register for each instruction in the program you're examining. If you really want to use MS-DEBUG (or any other debugger!) to examine the operation Two other sets which are often used together in The same way, but the programmer must still make sure that the CPU will use them as expected. For certain types of tasks, the registers are often grouped together in It does this by combining two 16-bit registers together to form a 20-bit Segment:Offset value ( which means it canĪccess over 1MB of Memory this way). OFFSET scheme whenever it needs to access Memory locations or Jump from one 64kb Segment to another. The 8086 CPU uses a method I'll call the SEGMENT: The other 16-bit ( two-byte ) registers of the 8086 CPU are: Each of these high and low halves can be accessed separately by program code: AX: Each of these registers has a High (H) and Low (L) 8-bit half which can store one Hexadecimal byte (1 byte The four main (16-bit) registers of an 8086 CPU are called: The Accumulator (AX), Base (BX), Count (CX) and Data (DX) Represented by sixteen Binary bits ( 65,535) is equivalent to FFFF in Hex. The Hexadecimal equivalent of a 12-bit Binary must have 3 digits (e.g., 101010111100 = ABC hex), and the largest Decimal number that can be Number has in Binary or Hexadecimal, you can switch between the two by grouping and converting every four Binary bits Two-digit Hex numbers (or 8-bit Binary numbers) are called bytes. When the ones and zeros of four Binary bits are grouped together (from 0000 to 1111 often called a nibble), they can be represented by a single Hex digit (from 0 to F) both of which are used to count from 0 to 15 in Decimal.Įight Binary bits (which allow for any Decimal value from 0 to 255) are represented by two Hex digits forĮxample, the Binary number 10101010 is equal to AA in Understanding texts that use a 16 or 32-bit FLAGS Registerįirst, a quick review of how Binary and Hexadecimal numbers are related:.( It may NOT be used for ANY other purpose UNLESS Page may be freely copied for PERSONAL use ONLY !