I'm trying to assemble debug.exe/com from the MS-DOS 2.0 source code, at first it wasn't working but I've been changing some filenames and I've managed to get an .obj file, using link(16-bit version) there is an error (error L2029: unresolved external) on some commands, and I don't know what to do, do I need to add some libraries?
Here's the errors and commands where it fails:
batch
C:\Users\<my_username>\Desktop\Assembly>link16.exe
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
Object Modules [.obj]: debug.obj
Run File [debug.exe]:
List File [nul.map]:
Libraries [.lib]:
Definitions File [nul.def]:
LINK : warning L4021: no stack segment
debug.obj(DEBUGGER) : error L2029: 'PARSERR' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'GO' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'REG' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'NAME' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'BYTEBUF' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'RELEASEPARITY' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DUMP' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'FILL' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DEFIO' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'LINEBUF' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'COMPARE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DSIZ' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'MOVE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'LOAD' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DEFDUMP' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'PARITYMES' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DISPB' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'TRACE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'TRAPPARITY' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'PERR' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'HEADSAVE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'BADVER' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DATAEND' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'ASSEM' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'LBUFSIZ' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'SPSAVE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'ENDMES' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'BACMES' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'ASMADD' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'SKIP_FILE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'PREPNAME' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'NEWEXEC' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'ZTRACE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DSSAVE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DISADD' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DWRITE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'DEBUG_FOUND' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'STACK' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'SEARCH' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'ENTER' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'QFLAG' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'INPUT' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'PARITYFLAG' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'UNASSEM' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'GETHEX' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'GETEOL' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'CSSAVE' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'CARRET' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'NOREGL' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'OUTPUT' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'USER_PROC_PDB' : unresolved external
debug.obj(DEBUGGER) : error L2029: 'IPSAVE' : unresolved external
There were 52 errors detected
The code, tools, and other dependencies I've used can be downloaded from here.
How can I fix these unresolved errors?
I made a script to assemble MS-DOS 2.00's DEBUG. Here's the script: https://hg.ulukai.org/ecm/msdos2/file/05669dfa5edd/v2.0/source/debug/makdebug.bat quoted in full:
@echo %DEBUG%off
masm debug debug debug;
masm debasm debasm debasm;
masm debcom1 debcom1 debcom1;
masm debcom2 debcom2 debcom2;
masm debconst debconst debconst;
masm debdata debdata debdata;
masm debmes debmes debmes;
masm debuasm debuasm debuasm;
link debug debasm debcom1 debcom2 debconst debdata debmes debuasm;
exe2bin debug
move /y debug.bin debug.com
In my repo I also moved all files for that into a subdirectory.
Update, 2024 September: I extracted the MS-DOS v2 sources for Debug into a repo I call MSDebug, and improved it in a few ways. I also ported the source texts to assemble with NASM and link with WarpLink and x2b2 so it is all FLOSS now, both the source and the build toolchain.
There's a manual now too, and it has a section on the updates I collected.