Buscar

lunes, 6 de mayo de 2013

Guide Programming - Part 2

  • Flag register: It is a 16 bit register, but only 9 bits are used. 6 of them are conditional flags. The remaining 3 are control flags . Flags perform logical operations. A flag can be either zero or one.      
 Visual Assembler only use 4 of them.
CF: The carry flag is set to 1 when an operation yields a carry.
ZF: The zero flag is set to zero when an operation yields zero.
SF: The sign flag is set if the result of an operation is negative number.
VF: The overflow flag indicates that the result cannot be stored in the register.


  •  Stack management: 
The stack in the 8086/8088 microprocessor, like that in many microprocessors, is a region of memory that can store information for later retrieval. It is called a stack, because you "stack" things on it. The philosophy is that you retrieve (pop) things in the opposite order of storing (push) them, or LIFO that stands for last in, first out. In the 8086/8088, the stack pointer is SP, which is a 16 bit pointer into a 20 bit address space. It, at any point of time, points to the last item pushed on the stack. If the stack is empty, it points to the highest address of the stack plus one.

Visual assembler automatically manages stack sector, so that the student programmer does not have to worry about the flow of BS and SP records, their increases or decreases.

SP points to the last item pushed on the stack.

No hay comentarios:

Publicar un comentario