Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/MTMC_ASSEMBLY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ There are 16 user-facing registers usable by name in assembly:
| 11 | `ra` | return address register, holds the return address for a function call |
| 12 | `fp` | frame pointer, points to the top of the current function frame |
| 13 | `sp` | stack pointer, points to the bottom of the current function frame |
| 14 | `bp` | break pointer, points to the top of the current heap space |
| 14 | `bp` | base pointer, points to the top of the current heap space |
| 15 | `pc` | program counter, points to the next instruction to execute |


Expand Down Expand Up @@ -105,7 +105,7 @@ Labels must be the first token on a line and must end with a colon. If you wish

Note that strings will be implicitly zero terminated.

The above data will be placed after the code segment in memory, in a data segment. The break pointer will point to the next memory cell after the data segment.
The above data will be placed after the code segment in memory, in a data segment. The base pointer will point to the next memory cell after the data segment.

Also note that the `#` character can be used for line comments.

Expand Down
2 changes: 1 addition & 1 deletion docs/MTMC_SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The MTMC has a total of 16 user-facing register. They are outlined below.
| 11 | `ra` | return address register, holds the return address for a function call |
| 12 | `fp` | frame pointer, points to the top of the current function frame |
| 13 | `sp` | stack pointer, points to the bottom of the current function frame |
| 14 | `bp` | break pointer, points to the top of the current heap space |
| 14 | `bp` | base pointer, points to the top of the current heap space |
| 15 | `pc` | program counter, points to the next instruction to execute |

In addition to these registers, there are the following non-user facing registers:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mtmc/emulator/Register.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum Register {
RA, // return address
FP, // frame pointer
SP, // stack pointer
BP, // break pointer
BP, // base pointer
PC,

//=== non-user-facing registers
Expand Down