- Text after start is refused, as text.c refuses it: before it jumps, the ROM reads on to the end of the source; blanks, comments and the ends of blobs may follow, a token is ERR-AFTER (26), "text after start". - A token too long where a name, a target or a value is wanted is "name too long", as text.c says: (MISSING) reports "missing" only when no error came first. `", keeps "missing", which is text.c's word for both. - text.c's "address out of range" names the address, not the value. - The system's source files are one list, v4/sys_files.h: boot.c, the harness and the nucleus test are made from it. - The ROM's error codes and words are one list, v4/rom_errors.h: boot.c's messages, host_map.h's ROM_ERR_* and mkmap's ERR-* are made from it. - node.h says what v4_node_store does with a ROM address (nothing, as for any address outside RAM, D-14); test_host_rom_range pins it. ROM: 2095 words, rom_hash 0x06d0dcb7a0cb41a1. dict_hash unchanged, 0xe5a57f3eb72ff94a. make -C v4 test test-32 hosted-check pass. QEMU: amd64, aarch64, riscv64 to ok>, POST 538/538, POST: PASSED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
2.4 KiB
C
44 lines
2.4 KiB
C
/* rom_errors.h -- the ROM's error codes and what they mean.
|
|
*
|
|
* The ROM (capsules/v4/rom) stops at (ROM-FAILED) with one of these codes in
|
|
* (FAILED); the loader, which owns the console, prints its words
|
|
* (v4/system/boot.c). This is the one list: the map's constants ERR-* the
|
|
* ROM is assembled with (v4/tools/mkmap.c, through v4/tests/host_map.h's
|
|
* ROM_ERR_*) and the boot's messages are both made from it. The codes run
|
|
* 1, 2, 3 ... in order; a new one goes at the end.
|
|
*
|
|
* X(NAME, CODE, WORDS)
|
|
*/
|
|
#ifndef V4_ROM_ERRORS_H
|
|
#define V4_ROM_ERRORS_H
|
|
|
|
#define V4_ROM_ERRORS(X) \
|
|
X(TOO_LONG, 1, "name too long") /* a token longer than 63 characters */ \
|
|
X(COMMENT, 2, "comment not closed") /* a ( with no ) before the end of its blob */ \
|
|
X(BAD_NAME, 3, "cannot be used as a name") /* an opcode, a reserved word, a label, a number or &... */ \
|
|
X(DEFINED, 4, "already defined") \
|
|
X(NAMES, 5, "too many names") /* the symbol table is full */ \
|
|
X(FIT, 6, "does not fit: memory is full, or a branch cannot reach") \
|
|
X(OPCODE, 7, "not an opcode the packer takes there") \
|
|
X(IN_MACRO, 8, "not allowed in a macro") \
|
|
X(MACRO, 9, "macro without endmacro, or endmacro without macro") \
|
|
X(LABEL_DUP, 10, "label already defined in this word") \
|
|
X(LABELS, 11, "too many labels in one word") \
|
|
X(FOR, 12, "FOR nested too deep, NEXT or UNEXT without FOR, or FOR without NEXT") \
|
|
X(UNEXT, 13, "FOR ... UNEXT must fit one instruction word and hold no literal") \
|
|
X(TARGET, 14, "not something to branch to") \
|
|
X(UNDEFINED, 15, "never defined") \
|
|
X(BIG, 16, "number does not fit a cell") \
|
|
X(AMP, 17, "& needs a word that is already defined") \
|
|
X(FETCH_P, 18, "write the number, not @p") \
|
|
X(MISSING, 19, "a name, a target, a value or a string is missing") \
|
|
X(DEEP, 20, "macros nested too deep") \
|
|
X(REFS, 21, "too many unresolved branches") \
|
|
X(VALUE, 22, "not a value") \
|
|
X(NO_START, 23, "the source ended with no start") \
|
|
X(START, 24, "start of something not a word") \
|
|
X(RANGE, 25, "address out of range") /* store outside RAM */ \
|
|
X(AFTER, 26, "text after start")
|
|
|
|
#endif
|