User Tools

Site Tools


blog:pushbx:2026:0913_mid_early_september_work_on_the_debugger

Mid early September work on the debugger

2026-09-13

This week I mostly worked on enabling different build options for the debugger, including _SYMBOLIC. One fix to the immediate assembler (immasm) also got done.

The symbolic option changes to the debugger depend on an earlier change:

Add symsnip directory include option to the makefile. This is a step towards supporting the _LINK _SYMBOLIC build, albeit not sufficient. It may eventually come down to including symsnip (and scanptab) as subrepos of the lDebug repo so that the makefile knows exactly where to find these source files, so that the dependency checks can be done in the expected way.

lDebug section of 2026-08-23 post

For now, the symsnip files live in a separate repo, just like scanptab and lmacros. They're not properly tracked as dependencies by the makefile. Moving some or all of these into hg subrepos would fix the path relative to the ldebug/source/ directory so that the proper makefile dependencies could be added. Or, the relative path could be hardcoded without using subrepos, assuming that the other repos are in sister directories of the ldebug repo.

lDebug (experimental repo)

The immediate assembler is rather baroque, particularly its handling of the special cases involving ip, cs, or ds. One question I had is how is a near JMP imm handled. Tracing an immasm command I found that the rel8 flag (dif6_immasm_rel8) is set for such an instruction. How so? It turned out that a near JMP imm first runs the assembler's code for a short JMP imm. This sets the immasm_rel8_target variable, and the flag, and then actually assembles using a rel8 of 0 so the short JMP form (EBh) is always selected. That's how a . jmp 0000 or . jmp 8000 is always handled by the rel8 code in the immediate assembler, and behaves as expected.

There is an unintended even more ingenious way that occurs in a different case: if . jmp near 8000 is entered, then the assembler's rel8 code runs first as before, but the alloweddist check will reject the modified rel8 encoding despite the all-zeroes rel value. The assembler goes on to encode the jump as an actual rel16 jump (E9h). But the flag and target variables are still set by the rejected rel8 handling, so everything works out as desired even though the assembler emitted the E9h jump.

The remaining changes concern building with different options, chiefly initiated by allowing the _SYMBOLIC option to build again.

symsnip

You could leave a comment if you were logged in.
blog/pushbx/2026/0913_mid_early_september_work_on_the_debugger.txt · Last modified: 2026-09-13 18:35:39 +0200 Sep Sun by ecm