1. SASM Flags Manipulation¶
File: sasm_flags.h
Author: Soham Metha
Date: January 2025
1.1. Table of Contents¶
1.2. Flags Enum¶
The Flags enumeration defines individual CPU flag bit masks, allowing manipulation of specific flags using bitwise operations.
| Flag | Bit Mask | Description |
|---|---|---|
| Halt | 1 << 0 | Halt flag |
| Sign | 1 << 1 | Sign flag |
| Overflow | 1 << 2 | Overflow flag |
| Carry | 1 << 3 | Carry flag |
| Borrow | 1 << 4 | Borrow flag |
| Parity | 1 << 5 | Parity flag |
| Zero | 1 << 6 | Zero flag |
1.3. Flag Manipulation Functions¶
1.3.1. Halt Flag¶
-
Set Halt Flag
Sets the Halt flag in the
CPUstructure based on the givenhaltvalue. -
Get Halt Flag
Returns the current state of the Halt flag.
1.3.2. Sign Flag¶
-
Set Sign Flag
Sets the Sign flag in the
CPUstructure based on the givensignvalue. -
Get Sign Flag
Returns the current state of the Sign flag.
1.3.3. Overflow Flag¶
-
Set Overflow Flag
Sets the Overflow flag in the
CPUstructure based on the givenoverflowvalue. -
Get Overflow Flag
Returns the current state of the Overflow flag.
1.3.4. Carry Flag¶
-
Set Carry Flag
Sets the Carry flag in the
CPUstructure based on the givencarryvalue. -
Get Carry Flag
Returns the current state of the Carry flag.
1.3.5. Borrow Flag¶
-
Set Borrow Flag
Sets the Borrow flag in the
CPUstructure based on the givenborrowvalue. -
Get Borrow Flag
Returns the current state of the Borrow flag.
1.3.6. Parity Flag¶
-
Set Parity Flag
Sets the Parity flag in the
CPUstructure based on the givenparityvalue. -
Get Parity Flag
Returns the current state of the Parity flag.
1.3.7. Zero Flag¶
-
Set Zero Flag
Sets the Zero flag in the
CPUstructure based on the givenzerovalue. -
Get Zero Flag
Returns the current state of the Zero flag.