nand2tetris/vm/README.md

30 lines
619 B
Markdown
Raw Normal View History

2020-06-01 14:19:55 +00:00
# VM Implementation
We have 8 segments:
- `argument`
- `local`
- `this/that`
- `pointer`
- `static` (shared)
- `constant` (shared)
- `temp` (shared)
RAM Address | Usage
2020-07-07 07:06:12 +00:00
------------|------------------
2020-06-01 14:19:55 +00:00
0-15 | Virtual Registers
16-255 | Static Variables (shared)
256-2047 | Stack
2048-16384 | Heap
16384-24575 | Memory mapped I/O
Register | Name | Usage
2020-07-07 07:06:12 +00:00
----------|--------|------
2020-06-01 14:19:55 +00:00
`RAM[0]` | `SP` | Stack Pointer
`RAM[1]` | `LCL` | `local`
`RAM[1]` | `ARG` | `argument`
`RAM[3]` | `THIS` | `this`
`RAM[4]` | `THAT` | `that`
RAM[5-12] | `temp` Segment
RAM[13-15]| General Purpose Registers