Cue lamentations of today's complexity mixed with feelings of life being great because of it.
Cue lamentations of today's complexity mixed with feelings of life being great because of it.
(OK, so it'll often be the output of a C compiler, but there's usually some work to be done in asm to get the system in a state with a stack, clocks, RAM etc to run a C program!)
CS pointed to the start of the code segment, DS to the start of the data segment. As long as the code segment plus the initialized data of the data segment was less than 64K, you could have a considerably larger runtime footprint (up to 128K) and still be a COM file with all near pointers.
Mighta been file.com. Mighta been real men.
x)y'!B:)),DM!G@))p,T]l%)),@@@Hello, world!$XP5]A%=!P[PZ^V!wV!wX5.<(GV(gX534,!(GWr!
My first version was shorter than 80 characters and "symmetrical" (same number of bytes before and after the string), but it didn't work on the 80486 and under DOSBox. The '486 needed an extra jump to clear the pipeline, and DOSBox didn't support the CP/M "CALL 5" interface.
The limitations are similar and you can do assembly level coding
C:\>DEBUG.COM
-A
^ Error
-N HELLO.COM
-L
-U 100 107
0340:0100 B409 MOV AH,09
0340:0102 BA0801 MOV DX,0108
0340:0105 CD21 INT 21
0340:0107 C3 RET
-
There is another copy of the debugger for MS-DOS v2.0 here: https://github.com/microsoft/MS-DOS/blob/master/v2.0/bin/DEB... This one does does have an assembler. C:\>DEBUG.COM
-A
0482:0100 MOV AH, 2
0482:0102 MOV DL, 41
0482:0104 INT 21
0482:0106 RET
0482:0107
-N A.COM
-R CX
CX 0000
:7
-W
Writing 0007 bytes
-Q
C:\>A
A
C:\>https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba...
The fun thing to do with it is send it your name and have it disassemble it.
(I use it to check the object code generated by the compiler. Instead of pretty-printing the instruction stream, it disassembles the binary object code. This helps to find mistakes in either the code generation or the disassembler, as they must match.)
Anyhow, feel free to incorporate it into your obj file dumper, exe file dumper, debugger, or any tool that can benefit by examining code.
It dates back to CP/M days.