Recreating Turbo Pascal 3.0 (compiler / editor / shell) in GNU Modula-2
(-fiso), starting with the shell.
Build: cd shell && make (gm2 16.0.1, -fiso; output shell/tpshell)
shell/Term.def / shell/Term.mod — raw termios keyboard + ANSI screen
(ClrScr, GotoXY, Marked/Normal, blocking GetCh, Beep).shell/Posix.def / shell/Posix.c — DEFINITION MODULE FOR "C" bridge
to libc: read/write/open/close/unlink/rename/getcwd/chdir/opendir/
readdir/closedir/statvfs + termios (tcgetattr/tcsetattr/cfmakeraw).shell/Shell.mod — TP3.0 main-menu shell, same keys and layout as the
original disassembled source (TPSRC4 kmenu / kcmdtab).shell/Makefile — builds via make. Note: gm2 only emits main when
the program module source is on the link line
(gm2 -fiso -o tpshell Shell.mod Term.o Posix.o).RESUME-TP3.md — full book-derived reference on the 8086 code the TP3
compiler generates for each Pascal construct (source of the compiler
phase design).Resources/ — TCAT pdfs / OCR of "Au coeur de Turbo Pascal",
TP3.0 reference manual, disassembled TPSRC1-10.Logged drive, Active directory, Work file,
Main file, Edit Compile Run Save / Dir Quit compiler Options,
Text: n bytes, Free: n bytes, > prompt. Command letters drawn
bold (TP3 uses high-bit chars)..PAS, Loading/New File, append-on-save.^Z EOF; old file -> .BAK via unlink+rename (TP3 order).*.* mask glob, No files,
k bytes free (statvfs).POINTER TO record) —
use ADDRESS and cast at the call site.FOR ... EXIT loops (use WHILE+flag).CR LF.*.* matches everything,
* matches runs, case-insensitive; skips ./...txt text buffer already in Shell.mod.