NEC V30MZ flags: Difference between revisions
(Created page with " = NEC V30MZ flags = == Layout == The V30MZ processor features a 16-bit flag register: 15 bit 8 7 bit 0 ---- ---- ---- ---- m111 odit sz0a 0p1c | |||| || | | | | |||| || | | +- Carry (CF<sup>CY</sup>) | |||| || | +--- Parity (PF<sup>P</sup>) | |||| || +------ Auxillary Carry (AF<sup>AC</sup>) | |||| |+-------- Zero (Z) | |||| +--------- Sign (S) | |||+------------ Single Step<sup>Break</sup> (TF<sup>BRK</sup>)...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
| |||| || | +--- Parity (PF<sup>P</sup>) | | |||| || | +--- Parity (PF<sup>P</sup>) | ||
| |||| || +------ Auxillary Carry (AF<sup>AC</sup>) | | |||| || +------ Auxillary Carry (AF<sup>AC</sup>) | ||
| |||| |+-------- Zero (Z) | | |||| |+-------- Zero (ZF<sup>Z</sup>) | ||
| |||| +--------- Sign (S) | | |||| +--------- Sign (SF<sup>S</sup>) | ||
| |||+------------ Single Step<sup>Break</sup> (TF<sup>BRK</sup>) | | |||+------------ Single Step<sup>Break</sup> (TF<sup>BRK</sup>) | ||
| ||+------------- Interrupt Enable (IF<sup>IE</sup>) | | ||+------------- Interrupt Enable (IF<sup>IE</sup>) | ||
Line 25: | Line 25: | ||
The following flags are typically modified by instructions: | The following flags are typically modified by instructions: | ||
=== Carry === | {{Anchor|CF}} | ||
=== CF - Carry === | |||
Stores the carry/borrow state of the last arithmetic operation, or the bit shifted to it for shift/rotate operations. | Stores the carry/borrow state of the last arithmetic operation, or the bit shifted to it for shift/rotate operations. | ||
=== Parity === | {{Anchor|PF}} | ||
=== PF - Parity === | |||
Set to <tt>1</tt> if, after arithmetic and logical operations, the lower 8 bits of the result are even. | Set to <tt>1</tt> if, after arithmetic and logical operations, the lower 8 bits of the result are even. | ||
=== Auxillary Carry === | {{Anchor|AF}} | ||
=== AF - Auxillary Carry === | |||
Stores the carry state from the lower 4-bit nibble (bits 0-3) to the higher 4-bit nibble (bits 4-7), or the borrow state from the higher nibble to the lower nibble. | Stores the carry state from the lower 4-bit nibble (bits 0-3) to the higher 4-bit nibble (bits 4-7), or the borrow state from the higher nibble to the lower nibble. | ||
=== Zero === | {{Anchor|ZF}} | ||
=== ZF - Zero === | |||
Set to <tt>1</tt> if, after arithmetic and logical operations, the result is equal to zero. | Set to <tt>1</tt> if, after arithmetic and logical operations, the result is equal to zero. | ||
=== Sign === | {{Anchor|SF}} | ||
=== SF - Sign === | |||
Set to <tt>1</tt> if, after arithmetic and logical operations, the highest bit of the result is set. | Set to <tt>1</tt> if, after arithmetic and logical operations, the highest bit of the result is set. | ||
=== Overflow === | {{Anchor|OF}} | ||
=== OF - Overflow === | |||
Set to <tt>1</tt> if an overflow occured as part of the arithmetic operation. | Set to <tt>1</tt> if an overflow occured as part of the arithmetic operation. | ||
Line 53: | Line 59: | ||
The following flags are typically modified by the developer: | The following flags are typically modified by the developer: | ||
=== Single step === | {{Anchor|TF}} | ||
=== TF - Single step === | |||
If set to <tt>1</tt>, after every instruction, a software interrupt (vector 1) is generated. | If set to <tt>1</tt>, after every instruction, a software interrupt (vector 1) is generated. | ||
Line 59: | Line 66: | ||
Alternatively referred to as the ''trap flag''. | Alternatively referred to as the ''trap flag''. | ||
=== Interrupt enable === | {{Anchor|IF}} | ||
=== IF - Interrupt enable === | |||
If set to <tt>1</tt>, enables maskable interrupt handling via the interrupt vector table; cleared to <tt>0</tt> as part of interrupt handling and restored by the <tt>IRET</tt> opcode. | If set to <tt>1</tt>, enables maskable interrupt handling via the interrupt vector table; cleared to <tt>0</tt> as part of interrupt handling and restored by the <tt>IRET</tt> opcode. | ||
=== Direction === | {{Anchor|DF}} | ||
=== DF - Direction === | |||
If set to <tt>1</tt>, string instructions decrement pointers as part of their operation; if set to <tt>0</tt>, the pointers are to be incremented. | If set to <tt>1</tt>, string instructions decrement pointers as part of their operation; if set to <tt>0</tt>, the pointers are to be incremented. | ||
=== Mode === | {{Anchor|MD}} | ||
=== MD - Mode === | |||
This flag does nothing on the NEC V30MZ. It was used to implement 8080 emulation mode in other V20/V30-family chips, but this functionality has been removed in the V30MZ. | This flag does nothing on the NEC V30MZ. It was used to implement 8080 emulation mode in other V20/V30-family chips, but this functionality has been removed in the V30MZ. |
Latest revision as of 11:04, 28 December 2024
NEC V30MZ flags
Layout
The V30MZ processor features a 16-bit flag register:
15 bit 8 7 bit 0 ---- ---- ---- ---- m111 odit sz0a 0p1c | |||| || | | | | |||| || | | +- Carry (CFCY) | |||| || | +--- Parity (PFP) | |||| || +------ Auxillary Carry (AFAC) | |||| |+-------- Zero (ZFZ) | |||| +--------- Sign (SFS) | |||+------------ Single StepBreak (TFBRK) | ||+------------- Interrupt Enable (IFIE) | |+-------------- Direction (DFDIR) | +--------------- Overflow (OFV) +-------------------- Mode (MD)
Status flags
The following flags are typically modified by instructions:
CF - Carry
Stores the carry/borrow state of the last arithmetic operation, or the bit shifted to it for shift/rotate operations.
PF - Parity
Set to 1 if, after arithmetic and logical operations, the lower 8 bits of the result are even.
AF - Auxillary Carry
Stores the carry state from the lower 4-bit nibble (bits 0-3) to the higher 4-bit nibble (bits 4-7), or the borrow state from the higher nibble to the lower nibble.
ZF - Zero
Set to 1 if, after arithmetic and logical operations, the result is equal to zero.
SF - Sign
Set to 1 if, after arithmetic and logical operations, the highest bit of the result is set.
OF - Overflow
Set to 1 if an overflow occured as part of the arithmetic operation.
Control flags
The following flags are typically modified by the developer:
TF - Single step
If set to 1, after every instruction, a software interrupt (vector 1) is generated.
Alternatively referred to as the trap flag.
IF - Interrupt enable
If set to 1, enables maskable interrupt handling via the interrupt vector table; cleared to 0 as part of interrupt handling and restored by the IRET opcode.
DF - Direction
If set to 1, string instructions decrement pointers as part of their operation; if set to 0, the pointers are to be incremented.
MD - Mode
This flag does nothing on the NEC V30MZ. It was used to implement 8080 emulation mode in other V20/V30-family chips, but this functionality has been removed in the V30MZ.