diff options
author | pommicket <pommicket@gmail.com> | 2021-11-11 12:54:20 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2021-11-11 12:54:35 -0500 |
commit | a8f48b329ae768c6cf8dfe676108851af99d5f60 (patch) | |
tree | 1e57549f0937aba6b25c75cd6daaa0a16ec12e1b /02 | |
parent | ea6989a71a221ed7a2cf144f7968fbbec2cec193 (diff) |
(03) storing label addresses
Diffstat (limited to '02')
-rw-r--r-- | 02/README.md | 8 | ||||
-rw-r--r-- | 02/in01 | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/02/README.md b/02/README.md index 1a77e50..d09c7ca 100644 --- a/02/README.md +++ b/02/README.md @@ -71,6 +71,7 @@ plus six new ones: - `--` outputs a label's (absolute) address - `:-` outputs a label's relative address - `##` outputs a number +- `~~` outputs 255 zeros - `//` is for comments - `\n\n` does nothing (used for spacing) @@ -172,6 +173,13 @@ since `0x90` gets inserted between the "load immediate" instruction code and the `\n\n` works identically, and lets us space out code a bit. But be careful: the number of blank lines must be a multiple of 3! +In the middle of the label table, you'll find a mysterious `ff` byte. This is at the position for +the command `~~` (the end of the command table overlaps with the start of the label table). +This command is just 255 bytes of zeros. If you defined a label whose position in the label +table overlaps with these zeros, you'd screw up the command. But fortunately, this will only happen +if you include `\r` or a non-printing character in your label names. +This is so that you can have big buffers to put data in (like our label table from this compiler). + ## limitations Many of the limitations of our previous compilers apply to this one. Also, @@ -16531,7 +16531,6 @@ unused padding linux doesn't seem to like writing at addresses past the end of the file. so we do have to include this -;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc;cc ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 @@ -16640,6 +16639,7 @@ so we do have to include this ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 +;ff;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 command ~~ outputs 255 bytes of zeros ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 ;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00;00 |