Symbols from MAP files¶
(Names you add yourself are a separate layer and win over these: Your own labels and comments.)
Load a symbol table with Map ▸ Load MAP File, which offers three formats:
- Z88DK Format… — the
.mapfilezccwrites next to your binary. Entries marked; addrare addresses. Entries marked; constare compile-time constants, such as the section bound__data_crt_head: they are kept by name only, so a script's@__data_crt_headresolves, but they never name an address in the views below. A name the file defines twice takes its first definition; a name that is both an address and a constant is the address. A symbol of a banked section (BANK_n,PAGE_n, and classic z88dk's$AC000form) names its address only while that page is mapped there; the other symbols are tied to the page mapped at their address when the map or the program is loaded. A map built withzcc -debugis accepted: its per-line markers (__C_LINE_…,__ASM_LINE_…) and C debug records (__CDBINFO__…) are not symbols and are ignored, so the function labels keep their addresses. C names: a C global or function (int counter;is_counterin the map, because the compiler prefixes every C name with_) also answers to its C name wherever you type an address or symbol (counter,@counter), and every view shows it ascounter. Only the symbols of a C module count (the map's module column ends in_c, asmain_cformain.c): assembler labels keep their names,_asm_bumpof an.asmfile included, and so do names that start with two underscores. A realcounterin the table wins: the C one is then shown as_counter. If two C files each have a staticinc,incis the first one's and the second is shown as_inc. The disassembly copy writes the assembler name (LD HL,_counter), so the pasted text still assembles. - Simple Format (48K ROM)… — plain
NAME = $ADDRlines, one per line,;for comments. JNEXT comes with one: see The 48K ROM by name. - sjasmplus Format (--sym, --exp)… — the symbol file sjasmplus writes with
--sym=FILEor--exp=FILE, lines such asmain.loop: EQU 0x00008006.--symlists every label (sorted by name from sjasmplus 1.21.1, in another order before; sjasmplus 1.18.0 and older leave out the labels whose name does not start with a letter, such as_start);--exponly the labels the sourceEXPORTs, in the order it exports them. The--symof sjasmplus 1.17.0 and older, which spells the keyword in lower case (main.loop: equ 0x00008006), loads as well. The names are sjasmplus's full ones (main.loop,gfx.draw). The file records no type, so every entry is a label: anEQUsize or a struct field offset names an address too (a disassembledLD BC,$1B00can readLD BC,SCRSIZE), andEXPORTis how you choose what is loaded. A value above0xFFFF, or a negative one, is ignored. The file records no memory bank either: of two labels at one address in different banks the first names the address, and both resolve by name. A Windows file, with CRLF line ends, loads as it is.
A file that is over 64 MiB, or is not a regular file (a named pipe, say), is
refused, and the box says why. A z88dk .map that sits beside a program you load
(<name>.map next to a .nex, .tap or .sna) is loaded for you, with the
program's source lines: see
Loading a source map.
Once loaded, symbols appear wherever an address is shown and a name is known: the disassembly replaces a matching 16-bit immediate with the symbol name, the Call Stack names call targets, the Breakpoints panel gains a Symbol column, and the disassembly right-click menu offers to watch the symbol by name. The open panels show the names as soon as the file is loaded.
Where two symbols share an address, the first one in the file wins.
The 48K ROM by name¶
Every JNEXT package includes 48rom.map, a symbol map of the 48K Spectrum ROM: 395 names for
its routines and system variables, taken from skoolkit's disassembly of the ROM. Load it with
Map ▸ Load MAP File ▸ Simple Format (48K ROM)…. It is in:
| Installed from | 48rom.map is in |
|---|---|
| the rpm or the deb | /usr/share/jnext/ |
| the Flatpak | /var/lib/flatpak/app/io.github.zxjogv.jnext/current/active/files/share/jnext/; for a --user installation, ~/.local/share/flatpak/ instead of /var/lib/flatpak/; inside the sandbox it is /app/share/jnext/48rom.map |
| a Windows zip | the folder you unzipped, next to jnext.exe |
the macOS .dmg |
inside the application: /Applications/jnext.app/Contents/Resources/ (in the file dialog, Cmd+Shift+G opens a folder by its path) |
| the source | data/ |
With it loaded, stepping through code that calls the ROM reads like a ROM listing:
- the Disassembly names what the code calls and reads:
CALL $03B5readsCALL BEEPER,LD HL,($5C5D)readsLD HL,(CH_ADD), and the Label column names each routine where it starts (a long name is cut short there); - step into a
RST $10and the Call Stack shows anRSTframe whose target isPRINT_A_CHARACTER; - a breakpoint can be set by name:
BEEPERin the Breakpoints panel's Add dialog stops where the ROM starts a beep, and the Symbol column saysBEEPER.
The names are not tied to a memory: they name those addresses whatever is paged in there, so
they describe the code only while the 48K ROM is (on a 48K machine, for one). --map does not
read this format: load the file from the Map menu.
On the command line, --map FILE loads a z88dk .map or an sjasmplus --sym
or --exp file. It tells them apart by the file's first line, not by its name
(z88dk's assembler also writes a .sym, in the map format). A file sjasmplus
wrote starts with a symbol line; one edited to start with a comment is read as
a z88dk map, so load it with Map ▸ Load MAP File instead. A script names a
symbol as @name, an sjasmplus label with its dots as @main.loop. A z88dk
map read before --load takes its page-bound symbols again at the program
load: see
Symbols.
NextBuild / Boriel ZX Basic programs come with a Memory.txt instead, which
JNEXT loads by itself when the program is loaded: see
Loading a source map. So do the labels of an
sjasmplus SLD source map, which come with it.