From af8160b31f5e816aabdfa969cf7e6232a559ae58 Mon Sep 17 00:00:00 2001 From: Pavlo Ivashkov Date: Mon, 8 Sep 2025 20:55:01 +0300 Subject: [PATCH] Fix BP name to base pointer --- docs/MTMC_ASSEMBLY.md | 4 ++-- docs/MTMC_SPECIFICATION.md | 2 +- src/main/java/mtmc/emulator/Register.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/MTMC_ASSEMBLY.md b/docs/MTMC_ASSEMBLY.md index f1c8117..3ac66cf 100644 --- a/docs/MTMC_ASSEMBLY.md +++ b/docs/MTMC_ASSEMBLY.md @@ -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 | @@ -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. diff --git a/docs/MTMC_SPECIFICATION.md b/docs/MTMC_SPECIFICATION.md index 32ab3bf..f3ce461 100644 --- a/docs/MTMC_SPECIFICATION.md +++ b/docs/MTMC_SPECIFICATION.md @@ -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: diff --git a/src/main/java/mtmc/emulator/Register.java b/src/main/java/mtmc/emulator/Register.java index 3793e93..f9aafb6 100644 --- a/src/main/java/mtmc/emulator/Register.java +++ b/src/main/java/mtmc/emulator/Register.java @@ -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