/* mkmap.c -- the memory map, as constants the ROM is assembled with. * * mkmap > rom-map-.f18 * * Runs on the build machine, built for the host node (HOST_WORDS and the * host stack sizes) at one cell width. It writes, as `constant` lines in * the text assembler's notation, the addresses and codes of * v4/tests/host_map.h that the ROM's source (capsules/v4/rom) uses: the * console's receive registers and the ROM's state area (MACHINE.md 2.1). * The map has one source, host_map.h; this is how the ROM reads it. */ #include "../tests/host_map.h" #include static void constant(const char *name, long value) { printf("constant %s %ld\n", name, value); } int main(void) { (void)host_load; /* host_map.h's loader is not this tool's */ (void)host_branch_slots; printf("\\ Generated by v4/tools/mkmap.c from v4/tests/host_map.h -- do not edit.\n"); constant("CONSOLE-RX", (long)CONSOLE_RX); constant("CONSOLE-STATUS", (long)CONSOLE_ST); constant("(TOK)", (long)ROM_TOK); constant("(TOKN)", (long)ROM_TOKN); constant("(PEEK)", (long)ROM_PEEK); constant("(LINE)", (long)ROM_LINE); constant("(EOF)", (long)ROM_EOF); constant("(FAILED)", (long)ROM_FAILED); constant("(ERRLINE)", (long)ROM_ERRLINE); constant("(NBASE)", (long)ROM_NBASE); constant("(NNEG)", (long)ROM_NNEG); constant("(NI)", (long)ROM_NI); constant("(NU)", (long)ROM_NU); constant("(NBIG)", (long)ROM_NBIG); /* the cell width's constants (NUMBER) needs, written as signed cells */ constant("MSB", (long)(v4_cell)V4_MSB); constant("DEC-LIMIT", (long)(v4_cell)(~(v4_ucell)0 / 10u)); constant("DEC-NLAST", -(long)(~(v4_ucell)0 % 10u) - 1); constant("HEX-HIGH", (long)(v4_cell)~(~(v4_ucell)0 >> 4)); constant("ERR-TOO-LONG", (long)ROM_ERR_TOO_LONG); constant("ERR-COMMENT", (long)ROM_ERR_COMMENT); return 0; }