If you load a program in Digital Research's SID86 debugger, you will receive information about the start and end address of the program after loading.
Start End
0917:0000 0917:07FF
This output can be obtained again in SID86with the V command.
#V
Start End
0917:0000 0917:07FF
In DEBUG from FreeDOS no such information is shown.
The only information you have is in the segment registers, but these values
can change. To obtain them again, you have to use the command L.
But theL command does only reload the registers with the correct values,
but these values do not mean, that it is the starting address of the whole
memory the program needs.
In the above SIDexample, the starting address is 0917:0000 but the code
starts at 0917:0400 which means 0917:0000 till 0917:03FF is probably used
for the Stack. SS points at0917 and SP at 037B.
The stack is thus 1024 Bytes in this example large.
The same program in DEBUG the SSand CS have the same value
SID therefore saves the start and end addresses separately and can use the Vcommand to display them even if the values in the segment registers have changed.
A similar function to show the start and end address would be desirable for FreeDOS' DEBUG.
In lDebug, FreeDOS Debug/X, and MS-DOS Debug you get the initial
bx:cxregister value after an L command which indicates the size of a flat-format executable or non-executable binary file. (In lDebug display this usingh bxcx.) This may be incompatible to how MZ .EXE files and .HEX files are handled, but for .COM files the register pair should give the size of the file. The starting location of the file is at PSP:100h in this case, equal tocs:ip.If we were to add a command like SID's V we would need to nail down exactly what is considered the start and end addresses.
Thank you for the information.
I tried that with a current version of LDEBUG.
LDEBUG.COM has a file size of 77824 Bytes on a floppy image, but when loading LDEBUG.COM with LDEBUG i get the following for
I also tried to check the size of my simple hello world program, which is an MZ EXE.
On floppy disk, it does have a size of 89 bytes.
In LDEBUG, when i try to unassemble the program bytes i count 22 Bytes for the code.
The "Hello World!$" string and the additional new line "#$" give me 13 + 2 = 15 bytes.
So the sum should be 22 Bytes + 15 Bytes = 37 Bytes.
I don't know that the other 89 Bytes - 37 Bytes are, but LDEBUG prints a:
The
ldebug.comfile is actually an MZ .EXE-style executable under the hood. Try runningldebug /F ldebug.comto load the file as if it was a flat-format binary.The other example is also somewhat expected for an MZ .EXE file. If you want me to look into it more, comment here with a hexdump of the file please.
The /F option worked for ldebug.com.
Here's the hexdump, i removed the # in my hello world program to make it a little smaller.
source code:
It compiles fine with JWASMR:
This is what I get when loading your program into lDebug, with and without the
/Fswitch:This gives 23 bytes for code, 1 zero byte of alignment I assume, plus 16 bytes of data. 40 bytes in total, matching
cx= 28h. This only covers the program image of the executable, not its MZ .EXE header. 30h bytes are used by the header, which must end on a paragraph boundary.Thank you for your answer.
I recently added an Extension for lDebug as requested by another user per email. It is called linfo.eld and once installed like
ext linfo.eld installit will display information on an executable file when it is being loaded:That works great. But i have two suggestions:
LINFOtoFILEINFO. This is more meaningful in my opinion.or as an alternative approach if you make the general help a part of the ext command:
Last edit: Oliver 2023-12-10
I think it displays information specifically about the L-command program load file, as specified by the N/K commands. I think FILEINFO could be mistaken as being more generic about what "files" it means, whereas LINFO is somewhat clearer that it is related to the L command.
Help will be added to the ELD.
How about calling it LFINFO for Load File Info?
Or DINFO, for Debuggee Info.
Thanks
However,
linfo helpwon't show the help. ELD help pages are always transient (only available for oneshot operation or if read by list.eld), never installed residently. So you will have to do withext linfo.eld help. Oh, just noticed it does have a transient help page already, although it is missing some of the features.Yes, that's what I assumed. The most important thing as of now would be that help can be accessed in a consistent way everywhere. And looks as uniform as possible.