v4 text.c: the address record (ADR step 3, task 1)
Every cell laid down that holds an address of the assembly is recorded, with its branch slot or 7 for the whole cell, as ARTIFACT.md's relocations need. Test first: test_text 13 checks failed before. test_host_rom_nucleus runs with the record on: 1825 branches, 664 whole cells, the ROM still equal word for word. v4 test, test-32 and ASan+UBSan pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -145,3 +145,36 @@ accepted before the next:
|
|||||||
3. `mkf18a` and `make -C v4 artifacts` (test 3).
|
3. `mkf18a` and `make -C v4 artifacts` (test 3).
|
||||||
4. The small train, placed at a base other than 0 (test 5).
|
4. The small train, placed at a base other than 0 (test 5).
|
||||||
5. The nucleus renamed to name order (3a), designed first: it changes the boot, so the protocol runs.
|
5. The nucleus renamed to name order (3a), designed first: it changes the boot, so the protocol runs.
|
||||||
|
|
||||||
|
## 8. Task 1 built (2026-11-19): `text.c`'s address record
|
||||||
|
|
||||||
|
**What changed:**
|
||||||
|
- `text.h` and `text.c`: `v4_text_record(t, buf, cap)` turns the record on, and `v4_text_addresses(t)` says
|
||||||
|
how many were recorded. Each entry is a cell and its slot, 0–3 for a branch field or 7
|
||||||
|
(`V4_TEXT_WHOLE_CELL`) for the whole cell. What is recorded:
|
||||||
|
- every branch, to a word or a label, back or forward, including `NEXT`'s;
|
||||||
|
- an `&NAME` literal in code, and `#, &NAME`;
|
||||||
|
- `here`, and a `set` variable that holds an address, wherever it is laid down (code, `#,`, `store`);
|
||||||
|
- a header's name cell, and its link when there is an entry before it.
|
||||||
|
|
||||||
|
The map's constants and plain numbers are not recorded. A full record is an error. With the record off,
|
||||||
|
nothing changes.
|
||||||
|
- **Found while building:** the nucleus lays its headers down with `set HDR-NFA here ... #, HDR-LINK`, not
|
||||||
|
with `header`. So a `set` variable carries whether it holds an address, or those links would be missed.
|
||||||
|
|
||||||
|
**Test first** (`logs/20261119-text-record/`):
|
||||||
|
- `test_text`: 15 new checks. Before the change, 13 failed: every one that expects an address recorded.
|
||||||
|
The two that expect nothing passed, as they should. Two errors in the tests themselves were fixed before
|
||||||
|
the change: `source` needs its `N-1` constant, and the notation is `FOR ... NEXT`, upper case.
|
||||||
|
- `test_host_rom_nucleus`, with the record on (test 4). On the system's source it records 1825 branches
|
||||||
|
and 664 whole cells. Every whole cell holds an address of the assembly, and the ROM's assembly is still
|
||||||
|
equal to it word for word, at both widths. This check could not be seen to fail before: the record did
|
||||||
|
not exist. It guards that the record changes no cell.
|
||||||
|
|
||||||
|
**Verified:**
|
||||||
|
- `make -C v4 test` passes: all tests at both widths, and the three mesh boots with POST 990/990.
|
||||||
|
- `make -C v4 test-32` passes.
|
||||||
|
- ASan+UBSan passes for every test at both widths, and for the mesh boot (POST 990/990). The run hit my
|
||||||
|
one-hour background limit at the 64-bit `test_host_mesh`, so the rest was run again from there.
|
||||||
|
`v4-gates.txt` and `v4-sanitize-rest.txt` hold the two parts.
|
||||||
|
- The boot does not use the record, so the kernel and the protocol are unchanged.
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
make: Entering directory '/home/user/LithosAnanke/v4'
|
||||||
|
[V4_CELL_BITS=64 run-64-test_text.c]
|
||||||
|
v4 text assembler tests: V4_CELL_BITS=64
|
||||||
|
257 checks, 0 failures
|
||||||
|
[V4_CELL_BITS=32 run-32-test_text.c]
|
||||||
|
v4 text assembler tests: V4_CELL_BITS=32
|
||||||
|
257 checks, 0 failures
|
||||||
|
make: Leaving directory '/home/user/LithosAnanke/v4'
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
make: Entering directory '/home/user/LithosAnanke/v4'
|
||||||
|
[V4_CELL_BITS=64 run-64-test_text.c]
|
||||||
|
v4 text assembler tests: V4_CELL_BITS=64
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:600: a call to a word defined already: its cell, slot 0
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:602: a call to a word defined later, once it is resolved
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:604: a branch in slot 1: its slot
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:606: a branch to a label of the word
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:608: FOR ... NEXT: the next's branch
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:610: &NAME in code: the literal's cell, whole
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:612: #, &NAME: its cell, whole
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:614: a set variable that holds here is an address
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:616: a set variable that holds &NAME, as a literal in code
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:622: a header: its name's cell; its link when there is an entry before it
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:625: store of an address: the cell stored
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:627: a record that is full is an error
|
||||||
|
FAIL /home/user/LithosAnanke/v4/tests/test_text.c:634: the record changes no cell
|
||||||
|
257 checks, 13 failures
|
||||||
|
make: *** [Makefile:358: run-64-test_text.c] Error 1
|
||||||
|
make: Leaving directory '/home/user/LithosAnanke/v4'
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
make: Entering directory '/home/user/LithosAnanke/v4'
|
||||||
|
[V4_CELL_BITS=32 run-32-test_host_rom_nucleus.c]
|
||||||
|
address record: 1825 branches, 664 whole cells
|
||||||
|
the ROM assembled the system: 63854391 instructions, 16656301 instruction words, 1.13 s (32-bit cells)
|
||||||
|
test_host_rom_nucleus: 8 checks, 0 failures
|
||||||
|
make: Leaving directory '/home/user/LithosAnanke/v4'
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
make: Entering directory '/home/user/LithosAnanke/v4'
|
||||||
|
cd /home/user/LithosAnanke/v4/build/v3o && cc -std=gnu99 -Wall -O2 -g -I/home/user/LithosAnanke/v3/include -I/home/user/LithosAnanke/kernel/include -c /home/user/LithosAnanke/v3/src/block_subsystem.c /home/user/LithosAnanke/v3/src/blkio_ram.c /home/user/LithosAnanke/v3/src/blkio_file.c /home/user/LithosAnanke/v3/src/log.c /home/user/LithosAnanke/v3/src/platform/platform_init.c /home/user/LithosAnanke/v3/src/platform/linux/time.c
|
||||||
|
ld -r /home/user/LithosAnanke/v4/build/v3o/*.o -o /home/user/LithosAnanke/v4/build/v3blocks.o
|
||||||
|
[V4_CELL_BITS=64 run-64-test_host_rom_nucleus.c]
|
||||||
|
address record: 1825 branches, 664 whole cells
|
||||||
|
the ROM assembled the system: 63864013 instructions, 16659023 instruction words, 0.96 s (64-bit cells)
|
||||||
|
test_host_rom_nucleus: 8 checks, 0 failures
|
||||||
|
make: Leaving directory '/home/user/LithosAnanke/v4'
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,161 @@
|
|||||||
|
make: Entering directory '/home/user/LithosAnanke/v4'
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_mesh.c]
|
||||||
|
v4 mesh tests: V4_CELL_BITS=64, V4_NODE_WORDS=32768
|
||||||
|
the flood: 268 sends tried: 2 refused at once, 121 let go on the way, 145 done; 1 of the two texts that set a node sending let go; (LOST) 122, (REFUSED) 124
|
||||||
|
between texts the nucleus used at most 3 cells of the data stack and 4 entries of the return stack
|
||||||
|
a node removed or a wire cut: 26895 times in all
|
||||||
|
244 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_node.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_node.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_node.c]
|
||||||
|
v4 host node tests: V4_CELL_BITS=64, V4_NODE_WORDS=32768
|
||||||
|
45 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_quit.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_quit.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_quit.c]
|
||||||
|
v4 host prompt tests: V4_CELL_BITS=64, V4_NODE_WORDS=32768
|
||||||
|
capsule: 7426 words
|
||||||
|
from the prompt, words may call each other 30 deep
|
||||||
|
1020 values may wait on the stack while the next line is typed and interpreted
|
||||||
|
defining and running a word from the prompt leaves 1017 data cells under it untouched
|
||||||
|
.S prints a stack of up to 1018 values; it needs 6 cells free
|
||||||
|
WORDS: 318 names, longest line 74 columns
|
||||||
|
1360 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_asm.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_asm.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_asm.c]
|
||||||
|
test_host_rom_asm: 472 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_in.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_in.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_in.c]
|
||||||
|
test_host_rom_in: 26 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_math.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_math.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_math.c]
|
||||||
|
v4 ROM math tests: V4_CELL_BITS=64
|
||||||
|
the host ROM: 2383 words; the mesh ROM: 265 words
|
||||||
|
156 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_nucleus.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_nucleus.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_nucleus.c]
|
||||||
|
address record: 1825 branches, 664 whole cells
|
||||||
|
the ROM assembled the system: 63864013 instructions, 16659023 instruction words, 1.85 s (64-bit cells)
|
||||||
|
test_host_rom_nucleus: 8 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_num.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_num.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_num.c]
|
||||||
|
test_host_rom_num: 31 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_pack.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_pack.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_pack.c]
|
||||||
|
test_host_rom_pack: 7 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_range.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_range.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_range.c]
|
||||||
|
test_host_rom_range: 19 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_rom_sym.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_rom_sym.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_rom_sym.c]
|
||||||
|
test_host_rom_sym: 81 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' -DV4_ROM_LINKED -DV4_ROM_SYM='"/home/user/LithosAnanke/v4/build/rom-64.sym"' -DV4_MESH_ROM_SYM='"/home/user/LithosAnanke/v4/build/mesh-rom-64.sym"' /home/user/LithosAnanke/v4/tests/test_host_unit.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/blocks.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/v4/build/san-v3blocks.o /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c -o /home/user/LithosAnanke/v4/build/san-64-test_host_unit.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_host_unit.c]
|
||||||
|
v4 unit tests: V4_CELL_BITS=64, V4_NODE_WORDS=32768
|
||||||
|
after POST and COLD: 212 of the 8302 cells below HERE differ from before POST (the first at 25); dict_hash differs
|
||||||
|
the four outer nodes: dict_hash=0xc8c659cdee409171
|
||||||
|
126 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_iword.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_iword.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_iword.c]
|
||||||
|
v4 iword tests: V4_CELL_BITS=64
|
||||||
|
1763 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_loops.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_loops.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_loops.c]
|
||||||
|
v4 loop tests: V4_CELL_BITS=64
|
||||||
|
code: 298 of 1024 words
|
||||||
|
loops run against C: 3008 (1696 more would run past 63 times and were left out)
|
||||||
|
DO .. LOOP headroom: data 5 below canary, return 6 below its return address
|
||||||
|
DO .. +LOOP headroom: data 5 below canary, return 6 below its return address
|
||||||
|
?DO .. LOOP headroom: data 5 below canary, return 6 below its return address
|
||||||
|
DO .. LEAVE .. LOOP headroom: data 5 below canary, return 6 below its return address
|
||||||
|
nested DO, I and J headroom: data 5 below canary, return 4 below its return address
|
||||||
|
3104 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_manage.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_manage.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_manage.c]
|
||||||
|
v4 manage tests: V4_CELL_BITS=64
|
||||||
|
78 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_node.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_node.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_node.c]
|
||||||
|
v4 node tests: V4_CELL_BITS=64, 1024 words
|
||||||
|
node: 1024 words + 52 head + 52 tail boundary (10.2% overhead)
|
||||||
|
1078 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_numout.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_numout.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_numout.c]
|
||||||
|
v4 number-output tests: V4_CELL_BITS=64
|
||||||
|
code: 382 of 1024 words
|
||||||
|
SPACES headroom: data 6 below canary, return 7 below its return address
|
||||||
|
. headroom: data 3 below canary, return 2 below its return address
|
||||||
|
.R headroom: data 3 below canary, return 2 below its return address
|
||||||
|
U. headroom: data 3 below canary, return 3 below its return address
|
||||||
|
U.R headroom: data 3 below canary, return 3 below its return address
|
||||||
|
D. headroom: data 3 below canary, return 2 below its return address
|
||||||
|
D.R headroom: data 3 below canary, return 2 below its return address
|
||||||
|
25242 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_pictured.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_pictured.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_pictured.c]
|
||||||
|
v4 pictured-output tests: V4_CELL_BITS=64
|
||||||
|
<# #S #> headroom: data 3 below canary, return 3 below its return address
|
||||||
|
signed picture headroom: data 3 below canary, return 2 below its return address
|
||||||
|
4716 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_port.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_port.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_port.c]
|
||||||
|
v4 port tests: V4_CELL_BITS=64
|
||||||
|
25 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_printing.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_printing.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_printing.c]
|
||||||
|
v4 printing tests (? Q.PRINT DUMP BASE HLD): V4_CELL_BITS=64
|
||||||
|
code: 506 of 1024 words
|
||||||
|
DECIMAL headroom: data 7 below canary, return 8 below its return address
|
||||||
|
? headroom: data 3 below canary, return 2 below its return address
|
||||||
|
Q.PRINT headroom: data 3 below canary, return 3 below its return address
|
||||||
|
DUMP headroom: data 3 below canary, return 4 below its return address
|
||||||
|
13439 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_stack.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_stack.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_stack.c]
|
||||||
|
v4 stack tests: V4_CELL_BITS=64, data depth 10, return depth 9
|
||||||
|
exhaustive: 2046 sequences of length <= 10
|
||||||
|
differential: 200000 ops
|
||||||
|
730137 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_strings.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_strings.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_strings.c]
|
||||||
|
v4 string tests: V4_CELL_BITS=64
|
||||||
|
code: 234 of 1024 words
|
||||||
|
COUNT headroom: data 6 below canary, return 6 below its return address
|
||||||
|
CMOVE headroom: data 4 below canary, return 5 below its return address
|
||||||
|
CMOVE> headroom: data 3 below canary, return 5 below its return address
|
||||||
|
MOVE headroom: data 5 below canary, return 6 below its return address
|
||||||
|
FILL headroom: data 4 below canary, return 5 below its return address
|
||||||
|
BLANK headroom: data 4 below canary, return 5 below its return address
|
||||||
|
-TRAILING headroom: data 5 below canary, return 6 below its return address
|
||||||
|
COMPARE headroom: data 3 below canary, return 5 below its return address
|
||||||
|
SEARCH headroom: data 2 below canary, return 5 below its return address
|
||||||
|
SCAN headroom: data 4 below canary, return 5 below its return address
|
||||||
|
SKIP headroom: data 4 below canary, return 5 below its return address
|
||||||
|
16729 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_terminal.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_terminal.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_terminal.c]
|
||||||
|
v4 terminal-output tests: V4_CELL_BITS=64
|
||||||
|
KEY headroom: data 8 below canary
|
||||||
|
EMIT headroom: data 7 below canary, return 8 below its return address
|
||||||
|
CR headroom: data 7 below canary, return 8 below its return address
|
||||||
|
TYPE headroom: data 5 below canary, return 6 below its return address
|
||||||
|
1212 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_text.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_text.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_text.c]
|
||||||
|
v4 text assembler tests: V4_CELL_BITS=64
|
||||||
|
257 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_umul.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_umul.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_umul.c]
|
||||||
|
v4 umul tests: V4_CELL_BITS=64
|
||||||
|
2808 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_CAPSULE_DIR='"/home/user/LithosAnanke/v4/capsule"' -DV4_SYS_DIR='"/home/user/LithosAnanke/capsules/v4/sys"' /home/user/LithosAnanke/v4/tests/test_wire.c /home/user/LithosAnanke/v4/src/asm.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/testcode.c /home/user/LithosAnanke/v4/src/text.c /home/user/LithosAnanke/v4/src/umul.c /home/user/LithosAnanke/v4/src/wire.c -o /home/user/LithosAnanke/v4/build/san-64-test_wire.c
|
||||||
|
[ASan+UBSan V4_CELL_BITS=64 san-64-test_wire.c]
|
||||||
|
v4 wire tests: V4_CELL_BITS=64, 1024 cells to a queue
|
||||||
|
112 checks, 0 failures
|
||||||
|
cc -std=c99 -Wall -Wextra -Wpedantic -Werror -O2 -g -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -D_POSIX_C_SOURCE=200809L -I/home/user/LithosAnanke/v4/include -isystem /home/user/LithosAnanke/v3/include -isystem /home/user/LithosAnanke/kernel/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -c /home/user/LithosAnanke/v4/tests/test_mesh_boot.c -o /home/user/LithosAnanke/v4/build/san-test_mesh_boot.o
|
||||||
|
cd /home/user/LithosAnanke/v4/build/san-v3o-mesh && cc -std=gnu99 -Wall -O2 -g -I/home/user/LithosAnanke/v3/include -I/home/user/LithosAnanke/kernel/include -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all -I/home/user/LithosAnanke/v4/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -c /home/user/LithosAnanke/v3/src/block_subsystem.c /home/user/LithosAnanke/v3/src/blkio_ram.c /home/user/LithosAnanke/v3/src/blkio_file.c /home/user/LithosAnanke/v3/src/log.c /home/user/LithosAnanke/v3/src/platform/platform_init.c /home/user/LithosAnanke/v3/src/platform/linux/time.c /home/user/LithosAnanke/v4/system/blocks.c
|
||||||
|
cc -std=c99 -Wall -Wextra -O2 -g -I/home/user/LithosAnanke/v4/include -I/home/user/LithosAnanke/kernel/include -I/home/user/LithosAnanke/v3/include -DV4_CELL_BITS=64 -DV4_NODE_WORDS=32768 -DV4_DATA_RING=1022 -DV4_RET_RING=31 -DV4_ROM_WORDS=4096 -O1 -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all /home/user/LithosAnanke/v4/build/san-test_mesh_boot.o /home/user/LithosAnanke/v4/system/mesh.c /home/user/LithosAnanke/v4/system/inference.c /home/user/LithosAnanke/v4/src/manage.c /home/user/LithosAnanke/v4/build/mesh-rom-64.c /home/user/LithosAnanke/v4/build/rom-64.c /home/user/LithosAnanke/v4/build/v4_map_64.c /home/user/LithosAnanke/v4/build/capsule_generated.c /home/user/LithosAnanke/v4/src/node.c /home/user/LithosAnanke/v4/src/exec.c /home/user/LithosAnanke/v4/src/stack.c /home/user/LithosAnanke/v4/src/iword.c /home/user/LithosAnanke/v4/src/heat.c /home/user/LithosAnanke/v4/src/guard.c /home/user/LithosAnanke/v4/src/image.c /home/user/LithosAnanke/v4/src/fabric.c /home/user/LithosAnanke/v4/src/capsule.c /home/user/LithosAnanke/v4/src/message.c /home/user/LithosAnanke/v4/src/wire.c /home/user/LithosAnanke/v4/system/boot.c /home/user/LithosAnanke/v4/system/post.c /home/user/LithosAnanke/v4/system/post_cases.c /home/user/LithosAnanke/kernel/src/capsule/capsule_find.c /home/user/LithosAnanke/kernel/src/capsule/capsule_validate.c /home/user/LithosAnanke/kernel/src/capsule/capsule_sig.c /home/user/LithosAnanke/kernel/src/capsule/capsule_blocks.c /home/user/LithosAnanke/kernel/src/hash/xxhash64.c /home/user/LithosAnanke/kernel/src/crypto/x509_ed25519.c /home/user/LithosAnanke/kernel/src/crypto/ed25519.c /home/user/LithosAnanke/kernel/src/crypto/fe25519.c /home/user/LithosAnanke/kernel/src/crypto/scalar25519.c /home/user/LithosAnanke/kernel/src/crypto/sha512.c /home/user/LithosAnanke/v4/build/san-v3o-mesh/*.o -o /home/user/LithosAnanke/v4/build/san-test_mesh_boot
|
||||||
|
[ASan+UBSan mesh boot, V4_CELL_BITS=64]
|
||||||
|
v4 mesh boot: V4_CELL_BITS=64
|
||||||
|
PARITY:V4_POST tests=990 pass=990 fail=0
|
||||||
|
120 checks, 0 failures
|
||||||
|
make: Leaving directory '/home/user/LithosAnanke/v4'
|
||||||
|
exit 0
|
||||||
@@ -111,9 +111,22 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned name; /* offset into pool */
|
unsigned name; /* offset into pool */
|
||||||
unsigned char kind;
|
unsigned char kind;
|
||||||
|
unsigned char addr; /* a set variable: its value is an address of the assembly */
|
||||||
v4_cell value; /* address, constant, or macro text offset */
|
v4_cell value; /* address, constant, or macro text offset */
|
||||||
} v4_text_symbol;
|
} v4_text_symbol;
|
||||||
|
|
||||||
|
/* THE ADDRESS RECORD (docs/v4.0.0/plans/2026-11-19-f18-artifact-build.md §2). A cell laid down
|
||||||
|
* that holds an address of this assembly -- a word's or a label's, `here`, or a set variable that
|
||||||
|
* holds one -- as ARTIFACT.md §5's relocations need it: the cell, and the slot (0-3) whose branch
|
||||||
|
* field holds the address, or V4_TEXT_WHOLE_CELL when the whole cell does (an &NAME literal, a
|
||||||
|
* header's name and link, `#,`, `store`). The map's constants and numbers are not addresses of
|
||||||
|
* the assembly, and are not recorded. */
|
||||||
|
#define V4_TEXT_WHOLE_CELL 7u
|
||||||
|
typedef struct {
|
||||||
|
v4_cell cell;
|
||||||
|
unsigned slot;
|
||||||
|
} v4_text_addr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned name;
|
unsigned name;
|
||||||
v4_asm_ref ref;
|
v4_asm_ref ref;
|
||||||
@@ -144,6 +157,9 @@ typedef struct {
|
|||||||
int header_pending; /* a header waits for its `:` */
|
int header_pending; /* a header waits for its `:` */
|
||||||
v4_cell next_id; /* the next word ID a header is given (#189, Phase 2) */
|
v4_cell next_id; /* the next word ID a header is given (#189, Phase 2) */
|
||||||
|
|
||||||
|
v4_text_addr *rec; /* the address record, or NULL when it is off */
|
||||||
|
unsigned rec_cap, nrec;
|
||||||
|
|
||||||
unsigned line;
|
unsigned line;
|
||||||
int failed;
|
int failed;
|
||||||
char message[224];
|
char message[224];
|
||||||
@@ -152,6 +168,13 @@ typedef struct {
|
|||||||
/* Start assembling at word address `origin` of node `n`. */
|
/* Start assembling at word address `origin` of node `n`. */
|
||||||
void v4_text_begin(v4_text *t, v4_node *n, v4_cell origin);
|
void v4_text_begin(v4_text *t, v4_node *n, v4_cell origin);
|
||||||
|
|
||||||
|
/* Turn the address record on, into `buf`, which holds `cap`: every address laid down from now on
|
||||||
|
* is recorded. More than `cap` is an error. v4_text_begin turns it off. It changes no cell. */
|
||||||
|
void v4_text_record(v4_text *t, v4_text_addr *buf, unsigned cap);
|
||||||
|
|
||||||
|
/* How many addresses have been recorded. */
|
||||||
|
unsigned v4_text_addresses(const v4_text *t);
|
||||||
|
|
||||||
/* Give NAME a value; written in the text it is a literal. */
|
/* Give NAME a value; written in the text it is a literal. */
|
||||||
void v4_text_constant(v4_text *t, const char *name, v4_cell value);
|
void v4_text_constant(v4_text *t, const char *name, v4_cell value);
|
||||||
|
|
||||||
|
|||||||
+62
-13
@@ -169,6 +169,26 @@ static int raw_token(v4_text *t, reader *r, char *tok)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* One cell appended at the next word address; nothing is being built. */
|
/* One cell appended at the next word address; nothing is being built. */
|
||||||
|
/* The address record: `cell` holds an address of this assembly, in the branch field of `slot`, or
|
||||||
|
* whole (V4_TEXT_WHOLE_CELL). Nothing when the record is off. */
|
||||||
|
static void note(v4_text *t, v4_cell cell, unsigned slot)
|
||||||
|
{
|
||||||
|
if (!t->rec || t->failed) return;
|
||||||
|
if (t->nrec == t->rec_cap) { fail(t, "too many addresses for the address record", NULL); return; }
|
||||||
|
t->rec[t->nrec].cell = cell;
|
||||||
|
t->rec[t->nrec].slot = slot;
|
||||||
|
t->nrec++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* `@p` and a literal that is an address of this assembly: the literal's cell follows the instruction
|
||||||
|
* word, after the literals before it in that word. */
|
||||||
|
static void lit_addr(v4_text *t, v4_cell value)
|
||||||
|
{
|
||||||
|
v4_cell cell = t->as.here + 1 + (v4_cell)t->as.nlit;
|
||||||
|
v4_asm_lit(&t->as, value);
|
||||||
|
if (!t->as.error) note(t, cell, V4_TEXT_WHOLE_CELL);
|
||||||
|
}
|
||||||
|
|
||||||
static void put_cell(v4_text *t, v4_cell value)
|
static void put_cell(v4_text *t, v4_cell value)
|
||||||
{
|
{
|
||||||
v4_asm *as = &t->as;
|
v4_asm *as = &t->as;
|
||||||
@@ -216,7 +236,9 @@ static void header(v4_text *t, reader *r)
|
|||||||
lay_name(t, name);
|
lay_name(t, name);
|
||||||
put_cell(t, t->next_id++);
|
put_cell(t, t->next_id++);
|
||||||
put_cell(t, 0);
|
put_cell(t, 0);
|
||||||
|
note(t, t->as.here, V4_TEXT_WHOLE_CELL); /* the name's address */
|
||||||
put_cell(t, nfa);
|
put_cell(t, nfa);
|
||||||
|
if (t->latest) note(t, t->as.here, V4_TEXT_WHOLE_CELL); /* the link, when there is an entry before */
|
||||||
put_cell(t, t->latest);
|
put_cell(t, t->latest);
|
||||||
check_asm(t, name);
|
check_asm(t, name);
|
||||||
if (t->failed) return;
|
if (t->failed) return;
|
||||||
@@ -242,9 +264,12 @@ static void check_asm(v4_text *t, const char *tok)
|
|||||||
|
|
||||||
static void branch_to(v4_text *t, unsigned op, v4_cell target, const char *tok)
|
static void branch_to(v4_text *t, unsigned op, v4_cell target, const char *tok)
|
||||||
{
|
{
|
||||||
|
v4_asm_ref ref;
|
||||||
place_branch(t);
|
place_branch(t);
|
||||||
v4_asm_branch(&t->as, op, target);
|
ref = v4_asm_branch_fwd(&t->as, op); /* v4_asm_branch, with its ref kept for the record */
|
||||||
|
v4_asm_resolve(&t->as, ref, target);
|
||||||
check_asm(t, tok);
|
check_asm(t, tok);
|
||||||
|
if (!t->failed) note(t, ref.addr, ref.slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void branch_later(v4_text *t, unsigned op, const char *name, int local)
|
static void branch_later(v4_text *t, unsigned op, const char *name, int local)
|
||||||
@@ -292,7 +317,7 @@ static void resolve(v4_text *t, unsigned i, v4_cell target)
|
|||||||
t->line = t->ref[i].line;
|
t->line = t->ref[i].line;
|
||||||
fail(t, "branch cannot reach", t->pool + t->ref[i].name);
|
fail(t, "branch cannot reach", t->pool + t->ref[i].name);
|
||||||
t->line = line;
|
t->line = line;
|
||||||
}
|
} else note(t, t->ref[i].ref.addr, t->ref[i].ref.slot);
|
||||||
t->ref[i] = t->ref[--t->nref];
|
t->ref[i] = t->ref[--t->nref];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,6 +349,7 @@ static void define(v4_text *t, const char *name, unsigned char kind, v4_cell val
|
|||||||
t->sym[t->nsym].name = intern(t, name);
|
t->sym[t->nsym].name = intern(t, name);
|
||||||
t->sym[t->nsym].kind = kind;
|
t->sym[t->nsym].kind = kind;
|
||||||
t->sym[t->nsym].value = value;
|
t->sym[t->nsym].value = value;
|
||||||
|
t->sym[t->nsym].addr = 0;
|
||||||
if (!t->failed) t->nsym++;
|
if (!t->failed) t->nsym++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,11 +401,12 @@ static void constant_directive(v4_text *t, reader *r)
|
|||||||
/* A VALUE in a directive: a number, a constant, a set variable, CONST+N,
|
/* A VALUE in a directive: a number, a constant, a set variable, CONST+N,
|
||||||
* here, or &NAME of a word already defined. 1 and its value, or 0 having
|
* here, or &NAME of a word already defined. 1 and its value, or 0 having
|
||||||
* failed. */
|
* failed. */
|
||||||
static int value_of(v4_text *t, const char *tok, v4_cell *out)
|
static int value_of(v4_text *t, const char *tok, v4_cell *out, int *addr)
|
||||||
{
|
{
|
||||||
const v4_text_symbol *s;
|
const v4_text_symbol *s;
|
||||||
int big;
|
int big;
|
||||||
if (strcmp(tok, "here") == 0) { *out = v4_asm_label(&t->as); return 1; }
|
*addr = 0;
|
||||||
|
if (strcmp(tok, "here") == 0) { *out = v4_asm_label(&t->as); *addr = 1; return 1; }
|
||||||
if (strcmp(tok, "#ids") == 0) { *out = t->next_id; return 1; } /* how many word IDs so far */
|
if (strcmp(tok, "#ids") == 0) { *out = t->next_id; return 1; } /* how many word IDs so far */
|
||||||
if (number_of(tok, out, &big)) {
|
if (number_of(tok, out, &big)) {
|
||||||
if (big) { fail(t, "number does not fit a cell", tok); return 0; }
|
if (big) { fail(t, "number does not fit a cell", tok); return 0; }
|
||||||
@@ -387,12 +414,12 @@ static int value_of(v4_text *t, const char *tok, v4_cell *out)
|
|||||||
}
|
}
|
||||||
if (tok[0] == '&' && tok[1] != 0) {
|
if (tok[0] == '&' && tok[1] != 0) {
|
||||||
s = find(t, tok + 1);
|
s = find(t, tok + 1);
|
||||||
if (s && s->kind == KIND_WORD) { *out = s->value; return 1; }
|
if (s && s->kind == KIND_WORD) { *out = s->value; *addr = 1; return 1; }
|
||||||
fail(t, "& needs a word that is already defined", tok + 1);
|
fail(t, "& needs a word that is already defined", tok + 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
s = find(t, tok);
|
s = find(t, tok);
|
||||||
if (s && (s->kind == KIND_CONST || s->kind == KIND_SET)) { *out = s->value; return 1; }
|
if (s && (s->kind == KIND_CONST || s->kind == KIND_SET)) { *out = s->value; *addr = s->kind == KIND_SET && s->addr; return 1; }
|
||||||
if (!s) {
|
if (!s) {
|
||||||
const char *plus = strrchr(tok, '+');
|
const char *plus = strrchr(tok, '+');
|
||||||
if (plus && plus != tok && plus[1] != 0) {
|
if (plus && plus != tok && plus[1] != 0) {
|
||||||
@@ -418,10 +445,12 @@ static void cell_directive(v4_text *t, reader *r)
|
|||||||
{
|
{
|
||||||
char tok[V4_TEXT_MAX_TOKEN + 1u];
|
char tok[V4_TEXT_MAX_TOKEN + 1u];
|
||||||
v4_cell v;
|
v4_cell v;
|
||||||
|
int addr;
|
||||||
if (r->depth != 1) { fail(t, "not allowed in a macro", "#,"); return; }
|
if (r->depth != 1) { fail(t, "not allowed in a macro", "#,"); return; }
|
||||||
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "#, without a value", NULL); return; }
|
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "#, without a value", NULL); return; }
|
||||||
if (!value_of(t, tok, &v)) return;
|
if (!value_of(t, tok, &v, &addr)) return;
|
||||||
(void)v4_asm_label(&t->as);
|
(void)v4_asm_label(&t->as);
|
||||||
|
if (addr) note(t, t->as.here, V4_TEXT_WHOLE_CELL);
|
||||||
put_cell(t, v);
|
put_cell(t, v);
|
||||||
check_asm(t, "#,");
|
check_asm(t, "#,");
|
||||||
}
|
}
|
||||||
@@ -451,15 +480,17 @@ static void set_directive(v4_text *t, reader *r)
|
|||||||
{
|
{
|
||||||
char name[V4_TEXT_MAX_TOKEN + 1u], tok[V4_TEXT_MAX_TOKEN + 1u];
|
char name[V4_TEXT_MAX_TOKEN + 1u], tok[V4_TEXT_MAX_TOKEN + 1u];
|
||||||
v4_cell v;
|
v4_cell v;
|
||||||
|
int addr;
|
||||||
v4_text_symbol *s;
|
v4_text_symbol *s;
|
||||||
|
|
||||||
if (r->depth != 1) { fail(t, "not allowed in a macro", "set"); return; }
|
if (r->depth != 1) { fail(t, "not allowed in a macro", "set"); return; }
|
||||||
if (!next_token(t, r, name)) { if (!t->failed) fail(t, "set without a name", NULL); return; }
|
if (!next_token(t, r, name)) { if (!t->failed) fail(t, "set without a name", NULL); return; }
|
||||||
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "set without a value", name); return; }
|
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "set without a value", name); return; }
|
||||||
if (!value_of(t, tok, &v)) return;
|
if (!value_of(t, tok, &v, &addr)) return;
|
||||||
s = (v4_text_symbol *)find(t, name);
|
s = (v4_text_symbol *)find(t, name);
|
||||||
if (s && s->kind == KIND_SET) { s->value = v; return; }
|
if (s && s->kind == KIND_SET) { s->value = v; s->addr = (unsigned char)addr; return; }
|
||||||
define(t, name, KIND_SET, v);
|
define(t, name, KIND_SET, v);
|
||||||
|
if (!t->failed) t->sym[t->nsym - 1u].addr = (unsigned char)addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* `store ADDR VALUE`: a word of RAM is given VALUE. */
|
/* `store ADDR VALUE`: a word of RAM is given VALUE. */
|
||||||
@@ -467,14 +498,16 @@ static void store_directive(v4_text *t, reader *r)
|
|||||||
{
|
{
|
||||||
char at[V4_TEXT_MAX_TOKEN + 1u], tok[V4_TEXT_MAX_TOKEN + 1u];
|
char at[V4_TEXT_MAX_TOKEN + 1u], tok[V4_TEXT_MAX_TOKEN + 1u];
|
||||||
v4_cell addr, v;
|
v4_cell addr, v;
|
||||||
|
int at_addr, v_addr;
|
||||||
|
|
||||||
if (r->depth != 1) { fail(t, "not allowed in a macro", "store"); return; }
|
if (r->depth != 1) { fail(t, "not allowed in a macro", "store"); return; }
|
||||||
if (!next_token(t, r, at)) { if (!t->failed) fail(t, "store without an address", NULL); return; }
|
if (!next_token(t, r, at)) { if (!t->failed) fail(t, "store without an address", NULL); return; }
|
||||||
if (!value_of(t, at, &addr)) return;
|
if (!value_of(t, at, &addr, &at_addr)) return;
|
||||||
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "store without a value", NULL); return; }
|
if (!next_token(t, r, tok)) { if (!t->failed) fail(t, "store without a value", NULL); return; }
|
||||||
if (!value_of(t, tok, &v)) return;
|
if (!value_of(t, tok, &v, &v_addr)) return;
|
||||||
if (addr < 0 || (v4_ucell)addr >= V4_NODE_WORDS) { fail(t, "address out of range", at); return; }
|
if (addr < 0 || (v4_ucell)addr >= V4_NODE_WORDS) { fail(t, "address out of range", at); return; }
|
||||||
v4_node_store(t->as.n, addr, v);
|
v4_node_store(t->as.n, addr, v);
|
||||||
|
if (v_addr) note(t, addr, V4_TEXT_WHOLE_CELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* `start NAME`: the text has ended; NAME is where the system starts. */
|
/* `start NAME`: the text has ended; NAME is where the system starts. */
|
||||||
@@ -589,7 +622,7 @@ static void one_token(v4_text *t, reader *r, const char *tok)
|
|||||||
if (tok[0] == '&' && tok[1] != 0) { /* the address of a word, as a literal */
|
if (tok[0] == '&' && tok[1] != 0) { /* the address of a word, as a literal */
|
||||||
s = find(t, tok + 1);
|
s = find(t, tok + 1);
|
||||||
if (!s || s->kind != KIND_WORD) { fail(t, "& needs a word that is already defined", tok + 1); return; }
|
if (!s || s->kind != KIND_WORD) { fail(t, "& needs a word that is already defined", tok + 1); return; }
|
||||||
v4_asm_lit(as, s->value);
|
lit_addr(t, s->value);
|
||||||
check_asm(t, tok);
|
check_asm(t, tok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -607,7 +640,8 @@ static void one_token(v4_text *t, reader *r, const char *tok)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (s && (s->kind == KIND_CONST || s->kind == KIND_SET)) {
|
if (s && (s->kind == KIND_CONST || s->kind == KIND_SET)) {
|
||||||
v4_asm_lit(as, s->value);
|
if (s->kind == KIND_SET && s->addr) lit_addr(t, s->value);
|
||||||
|
else v4_asm_lit(as, s->value);
|
||||||
check_asm(t, tok);
|
check_asm(t, tok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -645,6 +679,21 @@ void v4_text_begin(v4_text *t, v4_node *n, v4_cell origin)
|
|||||||
t->start = -1;
|
t->start = -1;
|
||||||
t->header_pending = 0;
|
t->header_pending = 0;
|
||||||
t->next_id = 0;
|
t->next_id = 0;
|
||||||
|
t->rec = NULL;
|
||||||
|
t->rec_cap = 0;
|
||||||
|
t->nrec = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void v4_text_record(v4_text *t, v4_text_addr *buf, unsigned cap)
|
||||||
|
{
|
||||||
|
t->rec = buf;
|
||||||
|
t->rec_cap = cap;
|
||||||
|
t->nrec = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned v4_text_addresses(const v4_text *t)
|
||||||
|
{
|
||||||
|
return t->nrec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void v4_text_constant(v4_text *t, const char *name, v4_cell value)
|
void v4_text_constant(v4_text *t, const char *name, v4_cell value)
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ static int failures = 0, checks = 0;
|
|||||||
static v4_node a, b;
|
static v4_node a, b;
|
||||||
static v4_text tx;
|
static v4_text tx;
|
||||||
|
|
||||||
/* node A: text.c assembles the system's source, map first and end last */
|
/* node A: text.c assembles the system's source, map first and end last, with the address record on
|
||||||
|
* (plans/2026-11-19-f18-artifact-build.md §4 test 4): the record must change no cell. */
|
||||||
|
static v4_text_addr rec[1u << 15];
|
||||||
static int build_a(void)
|
static int build_a(void)
|
||||||
{
|
{
|
||||||
char path[512];
|
char path[512];
|
||||||
unsigned i;
|
unsigned i;
|
||||||
v4_node_reset(&a);
|
v4_node_reset(&a);
|
||||||
v4_text_begin(&tx, &a, ROM_ORIGIN);
|
v4_text_begin(&tx, &a, ROM_ORIGIN);
|
||||||
|
v4_text_record(&tx, rec, (unsigned)(sizeof rec / sizeof rec[0]));
|
||||||
for (i = 0; i < ROM_SYS_FILES + 2u; i++) {
|
for (i = 0; i < ROM_SYS_FILES + 2u; i++) {
|
||||||
if (i == 0) snprintf(path, sizeof path, "%s/map-%d.f18", V4_SYS_DIR, V4_CELL_BITS);
|
if (i == 0) snprintf(path, sizeof path, "%s/map-%d.f18", V4_SYS_DIR, V4_CELL_BITS);
|
||||||
else if (i <= ROM_SYS_FILES) snprintf(path, sizeof path, "%s/%s.f18", V4_SYS_DIR, rom_system_files[i - 1]);
|
else if (i <= ROM_SYS_FILES) snprintf(path, sizeof path, "%s/%s.f18", V4_SYS_DIR, rom_system_files[i - 1]);
|
||||||
@@ -57,6 +60,20 @@ int main(void)
|
|||||||
CHECK(build_a(), "text.c assembles the system's source to its start: %s", v4_text_error(&tx));
|
CHECK(build_a(), "text.c assembles the system's source to its start: %s", v4_text_error(&tx));
|
||||||
idle_a = v4_text_start(&tx);
|
idle_a = v4_text_start(&tx);
|
||||||
CHECK(idle_a == v4_text_word(&tx, "(IDLE)"), "the system starts at (IDLE)");
|
CHECK(idle_a == v4_text_word(&tx, "(IDLE)"), "the system starts at (IDLE)");
|
||||||
|
{
|
||||||
|
unsigned i, branches = 0, whole = 0, bad = 0;
|
||||||
|
v4_cell end = v4_text_here(&tx);
|
||||||
|
for (i = 0; i < v4_text_addresses(&tx); i++) {
|
||||||
|
if (rec[i].slot == V4_TEXT_WHOLE_CELL) {
|
||||||
|
whole++;
|
||||||
|
if (a.mem[rec[i].cell] < (v4_cell)ROM_ORIGIN || a.mem[rec[i].cell] > end) bad++;
|
||||||
|
} else if (rec[i].slot < 4u) branches++;
|
||||||
|
else bad++;
|
||||||
|
}
|
||||||
|
printf(" address record: %u branches, %u whole cells\n", branches, whole);
|
||||||
|
CHECK(branches > 0 && whole > 0, "the address record holds the system's branches and whole-cell addresses");
|
||||||
|
CHECK(bad == 0, "every whole cell recorded holds an address of the assembly, every slot is 0-3 or 7: %u not", bad);
|
||||||
|
}
|
||||||
|
|
||||||
t0 = clock();
|
t0 = clock();
|
||||||
CHECK(rom_build_system(&b, &words), "the ROM started the system: P %ld, failed %ld at line %ld", (long)b.p,
|
CHECK(rom_build_system(&b, &words), "the ROM started the system: P %ld, failed %ld at line %ld", (long)b.p,
|
||||||
|
|||||||
@@ -223,6 +223,30 @@ static int refused(const char *src, const char *what, unsigned line)
|
|||||||
if (line && strncmp(v4_text_error(&tx), want, strlen(want)) != 0) { printf(" message was: %s\n", v4_text_error(&tx)); return 0; }
|
if (line && strncmp(v4_text_error(&tx), want, strlen(want)) != 0) { printf(" message was: %s\n", v4_text_error(&tx)); return 0; }
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/* The same with the address record on, `cap` entries. */
|
||||||
|
static v4_text_addr rec[64];
|
||||||
|
static int rec_ok(const char *src, unsigned cap)
|
||||||
|
{
|
||||||
|
v4_node_reset(&nb);
|
||||||
|
v4_text_begin(&tx, &nb, ORIGIN);
|
||||||
|
v4_text_constant(&tx, "VAR", VARS);
|
||||||
|
v4_text_record(&tx, rec, cap);
|
||||||
|
return v4_text_assemble(&tx, src) && v4_text_finish(&tx);
|
||||||
|
}
|
||||||
|
static int refused_rec(const char *src, unsigned cap, const char *what)
|
||||||
|
{
|
||||||
|
if (rec_ok(src, cap)) return 0;
|
||||||
|
if (strstr(v4_text_error(&tx), what) == NULL) { printf(" message was: %s\n", v4_text_error(&tx)); return 0; }
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/* 1 if the record holds (cell, slot) */
|
||||||
|
static int has(v4_cell cell, unsigned slot)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
for (i = 0; i < v4_text_addresses(&tx); i++) if (rec[i].cell == cell && rec[i].slot == slot) return 1;
|
||||||
|
for (i = 0; i < v4_text_addresses(&tx); i++) printf(" recorded: %ld slot %u\n", (long)rec[i].cell, rec[i].slot);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/* Run the word NAME of the last assembly on up to two arguments; its one result. */
|
/* Run the word NAME of the last assembly on up to two arguments; its one result. */
|
||||||
static v4_cell result(const char *name, unsigned argc, v4_cell a, v4_cell b)
|
static v4_cell result(const char *name, unsigned argc, v4_cell a, v4_cell b)
|
||||||
{
|
{
|
||||||
@@ -568,6 +592,49 @@ int main(void)
|
|||||||
"set, here, store and start are reserved");
|
"set, here, store and start are reserved");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* THE ADDRESS RECORD (plans/2026-11-19-f18-artifact-build.md §2, §4 test 1): with it on, every cell
|
||||||
|
* laid down that holds an address of this assembly is recorded, as ARTIFACT.md §5's relocations
|
||||||
|
* need it: the cell, and the slot whose branch field holds it (0-3) or 7 for the whole cell. */
|
||||||
|
{
|
||||||
|
static v4_cell before[sizeof nb.mem / sizeof nb.mem[0]];
|
||||||
|
CHECK(rec_ok(": A ; : B A ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN + 1, 0),
|
||||||
|
"a call to a word defined already: its cell, slot 0");
|
||||||
|
CHECK(rec_ok(": B C ; : C ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN, 0),
|
||||||
|
"a call to a word defined later, once it is resolved");
|
||||||
|
CHECK(rec_ok(": A ; : B dup A ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN + 1, 1),
|
||||||
|
"a branch in slot 1: its slot");
|
||||||
|
CHECK(rec_ok(": W L: dup if L ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN, 1),
|
||||||
|
"a branch to a label of the word");
|
||||||
|
CHECK(rec_ok(": F 3 FOR dup drop NEXT ;", 8) && v4_text_addresses(&tx) == 1 && rec[0].slot < 4u,
|
||||||
|
"FOR ... NEXT: the next's branch");
|
||||||
|
CHECK(rec_ok(": A ; : X &A drop ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN + 2, V4_TEXT_WHOLE_CELL),
|
||||||
|
"&NAME in code: the literal's cell, whole");
|
||||||
|
CHECK(rec_ok(": A ; #, &A", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN + 1, V4_TEXT_WHOLE_CELL),
|
||||||
|
"#, &NAME: its cell, whole");
|
||||||
|
CHECK(rec_ok("set P here #, P", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN, V4_TEXT_WHOLE_CELL),
|
||||||
|
"a set variable that holds here is an address");
|
||||||
|
CHECK(rec_ok(": A ; set P &A : X P drop ;", 8) && v4_text_addresses(&tx) == 1 && has(ORIGIN + 2, V4_TEXT_WHOLE_CELL),
|
||||||
|
"a set variable that holds &NAME, as a literal in code");
|
||||||
|
CHECK(rec_ok("set P here set P 5 #, P", 8) && v4_text_addresses(&tx) == 0,
|
||||||
|
"a set variable set again to a number is not an address");
|
||||||
|
CHECK(rec_ok(": Y VAR drop ; #, VAR constant K 5 #, K+1 #, 7", 8) && v4_text_addresses(&tx) == 0,
|
||||||
|
"constants and numbers are not addresses of the assembly");
|
||||||
|
CHECK(rec_ok("header N1 : N1 ; header N2 : N2 ;", 8) && v4_text_addresses(&tx) == 3
|
||||||
|
&& has(ORIGIN + 3, V4_TEXT_WHOLE_CELL) && has(ORIGIN + 9, V4_TEXT_WHOLE_CELL) && has(ORIGIN + 10, V4_TEXT_WHOLE_CELL),
|
||||||
|
"a header: its name's cell; its link when there is an entry before it");
|
||||||
|
CHECK(rec_ok(": T ; store 300 &T store 301 5", 8) && v4_text_addresses(&tx) == 1 && has(300, V4_TEXT_WHOLE_CELL),
|
||||||
|
"store of an address: the cell stored");
|
||||||
|
CHECK(refused_rec(": A ; : B A A ;", 1, "too many addresses"), "a record that is full is an error");
|
||||||
|
CHECK(ok(": A ; : B A ;") && v4_text_addresses(&tx) == 0, "with the record off, nothing is recorded");
|
||||||
|
|
||||||
|
static char four[sizeof source + 32];
|
||||||
|
snprintf(four, sizeof four, "constant N-1 %d\n%s", V4_CELL_BITS - 1, source);
|
||||||
|
CHECK(ok(four), "the four definitions assemble: %s", v4_text_error(&tx));
|
||||||
|
memcpy(before, nb.mem, sizeof before);
|
||||||
|
CHECK(rec_ok(four, 64) && memcmp(before, nb.mem, sizeof before) == 0 && v4_text_addresses(&tx) > 0,
|
||||||
|
"the record changes no cell");
|
||||||
|
}
|
||||||
|
|
||||||
CHECK(v4_node_guards_intact(&na) && v4_node_guards_intact(&nb), "guards intact");
|
CHECK(v4_node_guards_intact(&na) && v4_node_guards_intact(&nb), "guards intact");
|
||||||
|
|
||||||
printf(" %d checks, %d failures\n", checks, failures);
|
printf(" %d checks, %d failures\n", checks, failures);
|
||||||
|
|||||||
Reference in New Issue
Block a user