(docs) readme - Change 'register and flags' section to improve style and clarity

This commit is contained in:
n loewen 2023-09-23 20:47:16 -07:00
parent 83e980b685
commit b2933a50a0
1 changed files with 16 additions and 9 deletions

View File

@ -55,15 +55,22 @@ Usage: ./cardiograph.js [-i <file>]
### Registers and Flags
- `A` - accumulator
- `IP` - instruction pointer (aka program counter)
- `FLAGS` - flags: **O**verflow, **N**egative, **Z**ero, **C**arry
- in machine language, each flag is given a number:
- O = 3
N = 2
Z = 1
C = 0
- (bitwise, `0000 = ONZC`)
There are three registers:
1. **A**, an 8-bit accumulator
2. **IP**, an 8-bit instruction pointer (aka program counter)
3. **flags**, a 4-bit flag register
The four flags are **O**verflow, **N**egative, **Z**ero, and **C**arry.
(Overflow is the high bit and carry is the low bit.)
In decimal:
| O | N | Z | C |
|---|---|---|---|
| 3 | 2 | 1 | 0 |
### Instruction set