Steve,
your code is good. I had forgotten the topic. I think it's not necessary to save es on entry, because that holds only a pointer to the environment (we're speaking about a native DOS application). But pushing it makes no harm.
Hi Gunther,
Thanks. Right ES is not used in that version and need not be
saved. Note the ??? in the comment there. In an earlier version
I mentioned, it was more complex to cause a longer delay and I
used LES to load the tick count to ES:AX.
DLR_1:
STI ; 4 Sep 03
HLT ; 4 Sep 03
LES AX,DS:[ClockTic] ; Get timer 55 ms tick count
CMP AX,DX
JE DLR_1 ; Greater than Start?
CMP AX,BX
JE DLR_1 ; Greater than Start+1?
It also had a HLT for power saving for the HP 200LX MS-DOS
palmtop computer. (Which doesn't work with a Windows NTVDM.)
So I saved ES in that version. So it was "used", but as it turned
out, never usefully. So LES and HLT were dropped in the newer
version, and I thought about not saving ES, but not hard enough
apparently.
As an aside to Dave, to reduce CPU usage, I ended up using the
DOS keyboard functions rather than the BIOS keyboard functions.
Using the BIOS routines was simpler, but did not give control to the
Windows NTVDM to save CPU cycles.
Cheers,
Steve N.