(docs) readme - Change 'register and flags' section to improve style and clarity
This commit is contained in:
parent
83e980b685
commit
b2933a50a0
25
readme.md
25
readme.md
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue