Target: give meaning back to procN / globalN in the
Reversing-Turbo-Modula2-main/decompiled/COMPILER/ sources,
which compile but are unreadable.
Status: outline only, no semantic change to upstream sources.
Upstream folders are git-ignored (see ../.gitignore);
only docs/compiler/ is versioned.
docs/compiler/
00-overview.md this file, map + reading order
10-folders.md what each upstream folder contains
20-compiler-module.md Compiler.MOD/DEF: Record descriptor + Init procs
30-scanner-module.md Scanner: buffer, GetSym, Accept/Expect/Test
40-symtab-errors.md SymTab scopes + Errors reporting/recovery
50-codegen.md CodeGen MCode emitter + 2KB window + fixups
60-frontend.md COMPILE link: Pass1 + Statement + Express (no .MOD yet)
70-rename-plan.md ordered rename work plan procN/globalN -> real names
TAGGED-SUMMARY.md one-page tagged snapshot for `git tag`
Resident, overlaid in M2.COM:
Compiler + Scanner + SymTab + Errors + CodeGenDynamically loaded via Loader.Call:
COMPILE = link of Pass1 + Statemen + ExpressGENZ80 = native-code backend (if requested)Drivers:
C.MOD (MODULE M2C): ReadString -> inName -> Scanner.CompileScanner.Compile (proc30): MARK, Compiler.proc2, Call("COMPILE"),
then Call("GENZ80") if Compiler.global25ComLine: commandLine, inName, outName, codepos, execute20-compiler-module.md — the Record descriptor unlocks everything.30-scanner-module.md — token codes, GetSym/Accept/Expect.50-codegen.md — opcode table + Emit/Peek/Poke/Fixup.40-symtab-errors.md — scopes, .SYM import/export, error recovery.60-frontend.md — parsers that consume 1-4.70-rename-plan.md — execute renames in that dependency order.Note on sources: decompiled/COMPILER/*.{DEF,MOD} are CP/M text
(CRLF + 0x1A). Plain readers fail; use:
tr -d '\032\r' < Reversing-Turbo-Modula2-main/decompiled/COMPILER/SCANNER.MOD | less
Turbo-Modula-2-Reloaded-main/disk_content/COMPILER.DIR/SCANNER.MOD
is a stub (30x PROCnn; BEGIN END); the real logic is in the
Reversing-.../MCode_disassembly/*.txt disassemblies.