Flag Registers
One last important register is the flags register. These registers control
how certain instruction work, such as the conditional jumps (in BASIC,
they are like IF-THEN's). They are stored as bits (0's or 1's) in the flags
register. We will most often use:
-
zero => ZR/NZ (zero/not zero) - tells you whether an instruction
(such as subtraction):
-
yielded a zero as an answer sign => NG/PL (negative/positive), tells
you whether an instruction
-
yielded a positive or negative number carry => CY/NC (carry/no carry)
- tells you whether 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.
-
direction => DN/UP (decrement/increment) - tells a block instruction
to either move forward or backwards in reads and writes.
Return