CPU Registers
The CPU has 4 internal registers, each one of 16 bits. The first four, AX, BX, CX, and DX are general use registers and can also be used as 8 bit registers, if used in such a way it is necessary to refer to them for example as: AH and AL, which are the high and low bytes of the AX register. This nomenclature is also applicable to the BX, CX, and DX registers.
The registers known by their specific names:
Register |
Specific Name |
AX
BX
CX
DX
DS
ES
SS
CS
BP
SI
DI
SP
IP
F |
Accumulator
Base register
Counting register
Data register
Data segment register
Extra segment register
Battery segment register
Code segment register
Base pointers register
Source index register
Destination index register
Battery pointer register
Next Instruction pointer register
Flag register |
However we’ll use these register in interrupts programming through C in the next chapters in detail but learning the basics of assembly language here will be good ideal and it will help us through out the programming of disk operations etc.
It is possible to visualize the values of the internal registers of the CPU using the Debug program. To begin working with Debug, type the following prompt in your computer:
C:/>Debug <Enter>
On the next line a dash will appear, this is the indicator of Debug, at this moment the Instructions of Debug can be introduced using the following command:
- r <Enter>
All the contents of the internal registers of the CPU are displayed. An alternative of viewing them is to use the "r" command using as a parameter the name of the register whose value wants to be seen. For example:
-rbx <Enter>
This Instruction will only display the content of the BX register and the Debug indicator changes from "-" to ":"
When the prompt is like this, it is possible to change the value of the register which was seen by typing the new value and <Enter>, or the old value can be left by pressing Enter without typing any other value.
It is possible to change the value of the flag register, and use it as a control structure in our programs as we will see later. Each bit of the register has a special name and meaning, the following list describes the value of each bit, on or off and its relation with the operations of the processor:
Overflow
NV = there is no overflow
OV = there is an overflow
Direction
UP = forward
DN = backward
Interrupts
DI = deactivated
EI = activated
Sign
PL = positive
NG = negative
Zero
NZ = it is not zero
ZR = it is zero
Auxiliary Carry
NA = there is no auxiliary carry
AC = there is auxiliary carry
Parity
PO = uneven parity
PE = even parity
Carry
NC = there is no carry
CY = there is carry
|