Intel IA-32 Assembly Tutorial

EFLAGS has binary flags that either control the CPU operation or reflect the outcome of a CPU operation. Some machine instructions test and manipulate the processor flags. When the result of an unsigned arithmetic operation is too large to fit into the destination, the CF (Carry Flag) is set. When the result of a signed arithmetic operation is too wide to fit into the destination, the OF (Overflow Flag) is set. When the result of an arithmetic or logical operation creates a negative result, the SF (Sign Flag) is set. When the result of an arithmetic or logical operation creates result of zero, the ZF (Zero Flag) is set. The Auxiliary Carry flag is set when an arithmetic operation causes a carry from bit 3 to bit 4 in an 8-bit operand. The Parity flag sums the number of bits that are set in a number determining whether the sum is odd or even.

Protected Mode

Windows NT/2000/XP/Vista/7/8/8.1/10 run in protected mode. The segment registers (CS, DS, SS, ES, FS, GS) point to segment descriptor tables that the operating system uses to define the locations of individual program segments. A typical protected mode program has three segments: code, data and stack.

The Assembly Language Elements

Reserved Words

Reserved words can be:

Number Constants

hexadecimal9A3hh radix
binary010010bb radix
binary11010yy radix
decimal1390 
decimal2788dd radix
decimal2788tt radix
octal323oo radix
octal42qq radix

Character Constants

'A'
"W"

String Constants

'ABCDEFGHIJKLMNOPQRSTUVWXYZ',0
"Hello, World!",0
'90786',0
"Gracie's world",0
'The dog said "Woof!"',0

Notice that each string has a zero sentinal to terminate it.

Identifiers

An identifier is a programmer-created name. It may identify a constant, variable, procedure or code label. When creating identifiers, these rules apply:

Directive Examples

<< < [Page 2 of 14] > >>
Feedback
close