I know that DEBUG.EXE tries to be a 100 % replacement with identical behavior and look & feel of DEBUG.EXE from MS-DOS.
But there is one big problem in MS-DOS' DEBUG.EXE, the status register output is not very user friendly, and the same applies to DEBUG.EXE of FreeDOS.
As a user you have to know the meaning of the abbreviations when the status register values change.
In DEBUG.EXE the
Overflow Flag is called OV or NV, depending on the current value of the register.
The same applies to all the other registers:
Direction Flag = DN or UP
Interrupt Flag = EI or DI
Sign Flag = NG or PL
Zero Flag = ZR or NZ
Auxiliary Carry Flag = AC or NA
Parity Flag = PE or PO
Carry Flag = CY or NC
A typical output looks like this (for example after pressing r, t, or p):
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 NV UP EI PL NZ NA PO NC 0895:0100 8AE7 MOV AH, BH
This is not very user friendly and difficult to read. Especially for non English speakers.
If you don't know the abbreviations heart, you have to keep looking up which abbreviation stands for what. And when you work with it, errors creep in just because of the constantly changing names.
Thus could you offer an option in DEBUG.EXE to change the output format in a human readable form?
If you move the output of assembler directive (in this example "MOV AH,BH") a little bit to the left, then there is enough place to put zeros or ones directly under the status flag names and keep the flag names always the same.
That way the output could look like this and would be much more readable.
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 OF DF IF SF ZF AC PF CF 0895:0100 8AE7 MOV AH, BH 0 0 1 0 0 0 0 0
OF DF IF SF ZF AC PF and CF are the abbreviations of the status flag names and after the modification they always stay as they are, and only the value below in the next line changes.
OF = Overflow Flag Register
DF = Direction Flag Register
IF = Interrupt Flag Register
SF = Sign Flag Register
ZF = Zero Flag Register
AC = Auxualiary Carry Flag
PF = Parity Flag
CF = Carry Flag
And when then the CF and ZF changes, it would look like this:
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 OF DF IF SF ZF AC PF CF 0895:0100 8AE7 MOV AH, BH 0 0 1 0 1 0 0 1
Such an output is much easier to read and less error prone.
The 100 % compatibility to MS-DOS DEBUG.EXE could be kept, by providing this output with an option.
You could for example provide a command line parameter, lets call it /f for flags to change the output format of the status register flags from classic output to the new better readable one.
The user could then start DEBUG.EXE with:
debug /f
to have the new better and more readable and less error prone output format of the status register flags.
If this is not possible, because you need the free space in the third line of the output, you could as an alternative also just do it this way:
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 O0 D0 I1 S0 Z1 A0 P0 C1 0895:0100 8AE7 MOV AH, BH
In this case, the first char is the name of the status flag and the second char is its value which is 0 or 1.
And if the OF, SF and PF flag changes, it would look like this:
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 O1 D0 I1 S1 Z1 A0 P1 C1 0895:0100 8AE7 MOV AH, BH
And if you want improve that to make it easier to read, you could use a underline char _ instead of a 0 for the value zero. This would be easier to read, because it is easier to notice a change.
In this case, the output cold look like this:
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 O_ D_ I1 S_ Z1 A_ P_ C1 0895:0100 8AE7 MOV AH, BH
And when the IF and AC flag changes, it would look like this:
AX=0010 BX=00FF CX=FE2C DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0885 ES=0885 SS=0896 CS=0895 IP=0100 O_ D_ I_ S_ Z1 A1 P_ C1 0895:0100 8AE7 MOV AH, BH
What do you think about this suggestion?
No, this would also require more memory.
You seem to have figured this out elsewhere but for the record when I referred to "the extname ELD" I meant the ELD in the file "extname.eld" which you invoke as
ext extname.eld install
. After thatext foo
will search two spots for "foo.eld" then "foo.xld", first the current directory ("foo.eld" then "foo.xld") then the scripts path ("::scripts::foo.eld" then "::scripts::foo.xld").Added to main online help page.
I don't have anything in place yet to check things like this to make a description line or help mandatory. And we aren't shipping any Scripts for lDebug as yet.
However, today I implemented SLD0 format help for list.eld and it looks like this:
The description line I already mentioned before. The help starts with a comment (optionally prepended by an
@
) reading "helpstart" alone on a line. Next, every comment-only line (also optionally prepended by an@
in the first column) is part of the help, until the End Of File or a "helpend" line is encountered.At the moment i am in the process of configuring the default script ldebug.sld according to my preferences.
I noticed that ldebug shows the entire script when it starts. Would it be possible to suppress the output of the entire script and only show that the ldebug.sld script was loaded and executed?
Sometimes I still need the rest of the output from DOS that was printed before ldebug started. However, if the entire script is displayed, then the old output is lost due to scrolling.
You can hide a command line input being shown by prefixing a single line with an AT sign
@
(must be the very first text in a line, no blanks allowed before it), or hide the input of all subsequent lines by setting a YSF flag within the script: https://pushbx.org/ecm/doc/ldebug.htm#varysfIn the sources you can also find a way to quiet the normal (non-error) output of a command while reading from the RC buffer or a Y script file, at https://hg.pushbx.org/ecm/ldebug/file/783981207053/source/debug.asm#l2861
The YSF flag for that is found in https://hg.pushbx.org/ecm/ldebug/file/783981207053/source/debug.mac#l765
Like I mentioned you can use the YSF flags or
@
prefixes to hide display of a Script for lDebug running. If you want to have an indication of the script running, I recommend including a comment without an@
prefix, like; Welcome to lDebug!
at the start of the:applicationstartup
section.That's a good idea. Thank you for the tip and answer.
As for your other answers in the other feature requests, I won't be able to answer those until tomorrow. Unfortunately I have a few other things to do today.
Today I also added a bunch of commonly used DCO options to the INSTALL command, listed in the updated manual at https://pushbx.org/ecm/doc/ldebug.htm#cmdinstall
I will test that. Thank you.
Btw, i noticed that your current ldebug.zip development version contains duplicate files:
You could save a few kilobytes by only having the .com and .lst files once in the ZIP archive.
Last edit: Oliver 2023-07-02
Okay, i tested
from the available options. That's the one i will use. And they work fine.
So far I've also set flag style 3 in my default ldebug.sld configuration style. Others may follow:
But i have one more question. Could you update the mentioned manual section above in a way that it says more precisely which options GETINPUT and RHIGHLIGHT do exactly set?
In the other feature request you explained, that the command history can be triggered by using different options:
https://sourceforge.net/p/freedos/feature-requests/110/#3f72
So it would be nice to know, which one GETINPUT uses. The same applies to all the other INSTALL command options. This should be mentioned in my opinion in the manual.
I will add this to the manual. The
GETINPUT
noun uses DCO 800h, whileRHIGHLIGHT
uses DCO3 04_0000h.Thank you.
About the @ hiding sign i found a small minor bug.
It seems to be, that the first two lines are hidden even when no @ sign is used in front of them.
The following configuration file:
results in a command line output that looks like this:
So there is no
line before the
-
prompt as expected.I have to write my "Startup configuration file" message two times:
To see the message:
Would it also be possible to add a
PRINT
orECHO
command so that you don't see the semicolon?Output should be:
Or even better without the
&
if possible:And one more questions. Is it possible to print the version information via the script?
So that i get something like this:
The first line in your example is never actually executed. That's because the Y command is
y ::config::LDEBUG.SLD :applicationstartup
, so the debugger will skip to the goto destination label:applicationstartup
(Just as if the first line in the file was@goto :applicationstartup
.) You can put anything you want before the label. (You can also "end" a section withgoto :eof
, say if you want to have different sections for:applicationstartup
versus:devicestartup
.)And
goto
type jumping currently never displays the destination label line, even though it is "executed".I have considered that but did not yet add it. Likely I would want a
printf
if anything, to allow to format numbers and the like.There are no text environment variables in the lDebug scripting language, so no. But you can run
@?build
which will show a build date, and number of ancestors and source control revision IDs for several components.Thank you for your answer.
A printf would be even better.
The build date would be good enough, the rest is too much when it comes to output. Could this be extracted somehow by script so that only the date is given?
This is not possible with lDebug scripting. I added a new command
?VERSION
that displays only the first line, however.That's great. Thank you very much!
I added a printf Extension for lDebug, it is included in current release builds. Run it like
ext printf.eld "Hello World!\r\n"
to display a message. The message can include some printf escapes/format specifiers as well. I will have to get around to documenting all of those some time later.Your example works with that:
Displaying the version is still a challenge, there are the set.eld and variable.eld which allow to set Variables for lDebug (I suggest to use names with the letters "VLD" prepended) in lDebug's DOS environment block as well as expand VLDs in debugger commands. For example:
But there is no way yet to operate on the version text (which can include "release 7" or such) without writing your own Extension for lDebug. That is easier than modifying the debugger, but probably not for the faint of heart.
Thank you that works great. But i noticed an inconsistency:
Gives me a help and usage information for
co.eld
.But when i try this with
printf.eld
i get:Same with:
But now i know, what LIST.ELD does, this works:
It would be nice, if all extensions would behave the same when a general parameter like
help
is used.So this:
I would also suggest to rename LIST.ELD to INFO.ELD if it is there to show informations about ELD files, like the LIST.ELD's verbose parameter does.
It would also be great. if you could leave out the ELD extension.
One more question. Is it correct that ELD files, that must be installed with the INSTALL command do reserve memory, while ELD files, that are not installed with the INSTALL command do not require additional memory. They are just run and then the memory is freed again, correct?
I also tested the
SET.ELD
extension.So this feature works fine, too.
For the
variable.eld
file i could install it and print its help, but i don't know how to exactly use its features. Is it used in combination with set.eld?I haven't tested the other ELD files yet.
One more thing.
An alternative approach to implement a general help would be to bound it to the ext command:
That way you could also add information features to ext:
Last edit: Oliver 2023-12-10
No, this would require at least a residently installed ELD (possible, but I don't see the need) or changes to the debugger itself (absolutely not).
That's sad to hear. It would have improved usability and consistency. Especially if you also take INSTALL and LIST into account, as suggested in the other thread.
https://sourceforge.net/p/freedos/feature-requests/118/?page=3#05c4/e111/feb5/e17b/3469/808d/345e/592b/806f
But okay, I'll live with it then.
Yes, this is inconsistent. I might add a help to printf.eld later.
You can use
ext list.eld
without any parameter, it will display the help.I will consider this.
I prefer list.eld, but you can just copy it to info.eld if you prefer.
As mentioned elsewhere,
ext extname.eld install
will achieve this. (Forext list
commands with a pathname pattern passed to list.eld, you do still have to include the filename extensions in the pattern however.)This is correct, yes. Some ELDs are oneshot operation only, and thus only take up memory while running. Some ELDs can be installed residently (eg co.eld, extname.eld), and will then take up memory until uninstalled (eg
copyoutput uninstall
). Some ELDs can operate in either mode (eg set.eld, variable.eld, ldmem.eld). This distinction isn't the 100% truth however, as eg eldcomp.eld andset.eld run /E
will install themselves "residently" but only for a brief interval and then uninstall themselves afterwards automatically.To display the ELD memory blocks in use, run a command like
ext ldmem.eld eld
. At init time the ELD buffers can be increased using the /X (code space) and /Y (data space) switches to the DOS-mode debugger. They default to 16 KiB each IIRC.The reason that some ELDs can be installed is because either they want to modify the general operation of the debugger in some way, or I want to be able to use them while the debugger doesn't have DOS available (in InDOS mode), or, equivalently, while the bootloaded debugger doesn't have its FS available (auxiliary buffer is in use eg from RH mode, or don't want to call int 13h). By installing the ELD when possible, it can then be run during the times an ELD cannot be newly loaded.
variable.eld is a bit of an odd one out. It was supposed to be installed residently (using the
install
parameter) but would then modify every normal debugger command input to replace%variables%
. That means if you want to use a percent sign for anything else you should suddenly start to double it to escape it from variable.eld's wrath. (Uninstall withvariables uninstall
, note the additional S there.) It is now preferred (if you don't need it while InDOS) to runext variable.eld run <command %variable%>
where therun
parameter will make the ELD inject the following command to the debugger. Before the injected command actually runs, variable.eld will have unloaded itself from memory again. You can also use thedisplay
parameter to just display the result from the variable substitution.Like mentioned elsewhere, I recommend using variables starting with a "VLD" prefix as Variables for lDebug. You can access the usual DOS variables like %PATH% and %COMSPEC% using the ELDs as well, however. (But only lDebug and its child processes execed after a change will get the modifications, not a debugger parent process like the DOS's shell.)
Okay, but it doesn't work the same way with some other elds.
The following examples are special, because there it does really make sense to have a very short command to save unnecessary typing but this also shows why it is a good reason to introduce a help parameter for ext
ext help name.eld
or introduce a @ character to run extensions as suggested before.Here again, i assumed that i will get a help screen like in the
ext list.eld
examples above:The following example i mention separately because this can be dangerous and lead to data loss.
As in the
ext list.eld
examples above, i assumed it will print me a help information first:Well, this unexpectedly and immediately terminated my VM.
Here the user should at least be asked with a (Y/N) answer and an information text in front of it whether he really wants to turn off the computer.
BTW i now think i know what you meant with the eld ommiting the extension thing. It seems to work, but the parameter listed in the help file seem to have no effect:
Summary:
At the moment the help output for some extensions is very inconsistent. With some you get help if you leave out the help parameter, with others you have to specify it and others only give the help via
ext list.eld eldfile help
.It would probably make the most sense, as already suggested, to execute the extensions only by preceding them with an @ sign.
Another thing I noticed is the formatting of the help. The output here also seems to be very inconsistent. Some help uses indentation, others don't.
Here you could use the help output of the DOS programs or a man page like in Unix/Linux as example.
I agree here now. At first I didn't know that you could use list.eld to list all ELD files. At first I thought this was just to get information about a single ELD file.
This
ext list.eld *.?LD
definitely belongs in the help of list.eld.Thanks.
Thank you for the clarification.
I would suggest including a date in the ELD file format indicating whether this is an extension that remains resident in memory or does not do so, or allows both.
That would be quite sufficient as an overview.
Especially if you could then display this date using something like an
ext list.eld *.?LD
command.That's very helpful and a useful command. Thank you.
Thanks also for your explanation of variable.eld
printf.eld now has a help which will show with
ext printf.eld
(empty command line tail) orext printf.eld help
.The *oth.eld files require an "oher link" debugger to be resident and have its
install amis
andext amisoth.eld install
having run. I may consider adding a more informative message but the check runs very early during the ELD's linking, not later when the ELD itself is running.I added an DCO7 option instead. If you
install quickrun
then an emptyext quit.eld
(or anext quit.eld install
followed by emptyquit
) will act as before, trying to shut down the (virtual) machine. Without the DCO7 enabled, quit.eld will now require therun
keyword to actually run its main code.This is what the help says:
It may not be too clear but you can run
extname warnext
to view the warn extension status,extname warnext off
to switch it off, andextname warnext toggle
to toggle orextname warnext on
to switch it back on. That's what "where keyword is one of" means here.I will consider this. Presumably dosdir.eld should also specify what patterns can be used.
That shouldn't require much memory so I may add it.