You are on page 1of 2

FLAGS (FLAG REGISTER):

In computer science, a flag is a value that acts as a signal for a function or process.
The value of the flag is used to determine the next step of a program. Flags are often
binary flags, which contain a boolean value (true or false). However, not all flags are
binary, meaning they can store a range of values.
 This is a special register with individual bit positions assigned to show he status
of he
 CPU or the results of arithmetic operations.
Each relevant bit is given a name and others are undefined.

Types:
Zero Flag (ZF)
If the result is zero, zero flag is set. Once a flag is set, it remains in that state until another
instruction that affects the flags is executed Not all instructions affect all status flags.
add and sub affect all six flags
inc and dec affect all but the carry flag
mov, push, and pop do not affect any flags

Sign Flag (SF)

Indicates the sign of the result. Useful only when dealing with signed numbers
MOV AL,15
ADD AL,97
Clears the sign flag as sets the sign flag as the result is 112 (or 0111000 in binary)
MOV AL,15
SUB AL,97
sets the sign flag as the result is -82 (or 10101110 in binary)

Carry Flag (CF)


Records the fact that the result of an arithmetic operation on unsigned numbers is out of
range.
Overflow Flag (OF)
Indicates out-of-range result on signed numbers. Signed number counter part of the carry
flag.

Auxiliary flag (AF):


Indicates whether an operation produced a carry or borrow in the low-order 4 bits (nibble)
of 8, 16 or 32
Bit operands (i.e. operand size doesn’t matter)

Effective index:

Effective index is the ratio of the propagation constant in the waveguide to the free
space propagation constant. There can be more than one effective indices depending
on the modes that are excited in the waveguide.

Off set Address:


The offset address in an 8086 is the logical address that the program "thinks about"
when it addresses a location in memory. The Execution Unit (EU or CPU) is
responsible for generating the offset address.

Counter Register:
Registers and counters. ... In the simplest form, a flip-flop is a one-bit register.
Acounter is simply a register with combinational logic to implement counting that is it is
possible to retrieve the contents, add or subtract one to the contents, and then store it
back into the register in one operation.

IP (Instruction pointer):
IP register always works together with CS segment register and it points to
currently executing instruction .

 MODEL directive
Specify how many code and data segments are necessary for the program. There are
many several types of memory small, compact, medium, large, etc.

For example

.model small

It shows that’s no more than 64 k memory for code and 64k for data.

You might also like