Flag Register
One last important register is the flag register. This register controls how certain
instruction will work, such as conditional jumps (in BASIC, they are like IF-THEN's).
They are stored as bits (0's or 1's) in the flag register. Depending on the result of
an instruction (i.e. CMP) the values may be:
- ZR/NZ (zero/not zero) - an instruction (such as subtraction)
yielded a zero as an answer sign.
- NG/PL (negative/positive) - an instruction yielded a positive or negative
number
- CY/NC (carry/no carry) - an instruction needed to carry a bit (like in
addition, you carry a number over to the next digit). Various system (BIOS) functions
use this flag to denote an error.
- DN/UP (decrement/increment) - instructs a block command to either move forward
or backwards in reads and writes.
Return