Processor's registers

    Like high-level programming languages offer us variables to store data or work with numbers in assembler we use for this purpose memory, free bytes. But we can't always acces them directly thus there are registers integrated registers in a processor. Their length is one or two bytes and only using them we can execute all assembler's instructions.

    There are eight basic eight-bit registers named AH, AL, BH, BL, CH, CL, DH and DL. In fact they are higher and lower (high, low) parts of four basic doubleregisters (i.e. sixteen-bit registers) AX, BX, CX and DX. AL (AX) is the basic register, so called accumulator, using it we can execute most of operations. BX is useful in addressing, CX is used in loops and finally DX for sixteen-bit arithmetics. But it's just their rough using.

    For our work we will need also sixteen-bit registers ES,SI and DI. DI is used for addressing, especially for writing data (istruction STOS), SI has similar using and ES is a segment register. If we want to use memory larger than 65536 bytes (scope of a sixteen-bit register), we need segment registers for determination of the active section in memory (segment), which we want to work with.

    Next special register is so called status register or flag register. It's filled with one-bit data elements of type true/false (1/0), which give information about executing the very last instruction. We learn to use two of them:

CF = Carry Flag - so called overflow flag - is the most important. After arithmetic instructions it indicates overflow, i.e. transfer from the most signifikant bit.

ZF = Zero Flag. After logic and arithmetic instructions it indicates that the result was zero.