blog:pushbx:2025:0803_july:august_work
Table of Contents
July/August work
2025-08-03
callver, fdapm, seekext
Preserve CF when chaining to the int 21h downlink:
For seekext, additionally:
- Increment version number to 1.22
- Update attribution year from 2024 to 2025.
Preserving CF for int 21h handlers is based on an answer on stackoverflow in which I modified an example to create an int 21h hook that can call its downlink (using pushed flags and a far call). The needed modifications:
- Pass CF and ZF returned from the downlink call to our caller, done using
lahfand setting upbpto access the iret frame. - Chain certain functions (00h, 26h, 31h, 4Bh, 4Ch) using a far jump to the downlink rather than using the pushf and far call. As mentioned, dosemu2 passes the same functions like a jump.
- Pass input flags to the downlink (either in the far call or far jump). DOS probably doesn't care about the live flags in the
flregister, but another caller usingpushfwould pass along the liveflto its iret stack frame. - Free the environment and close all process file handles.
LZEXE
- Allow to disable long literal support at build time in lzss.nas
- Allow to disable 4 KiB window support at build time in lzss.nas
- Add a third build of lzss.nas, for lzexedat.
- Disable -l and -4 support in the lzss.nas builds for TPC and FPC lzexe.pas
- lzexedat: Move the input and output buffers into a separate segment called BUFFER.
- Add new mak.sh which calls makfpc.sh
- Fix to use different listing filenames for the three builds of lzss.nas
- doc: Update news-r4
- Add -c switch to lzexedat to use 0000h as the combined word for EOS and segment change commands, and document it (also in the news).
- lzexedat: Fix a branch to openoutfile.error which was accidentally jumping to openinfile.error
- Add file depack.asm picked from lDebug repo.
- Add lzexedat -d mode to depack instead of packing.
- Document -d and -h switches to lzexedat.
- List -d and -h switches in the news-r4 section.
- Optimise depack.asm:
- Add _DXTAG option to keep the tag word in dx, rather than the offset behind the circular buffer's end. (Picked from lDebug repo.)
- Re-use part of get_bit to initialise the tag word. (Picked from lDebug repo.)
- Store the tag position as a cycle mask rotating a single set bit through the word's 16 bits instead of a byte counter that counts down from 16. The advantage is one instruction less as the cycle mask needn't be re-initialised like the counter does need to be. (Picked from lDebug repo.)
inicomp lzexedat.asm
- Add testfile display of every literal (extra verbose), EOS, seg change, and long literal commands (extra verbose or exceptional). (Extra verbose means two -v switches specified.)
- Add dest and src displays to long command display.
- Shorten the long literal length display text. (Avoid wrapping at the end of the terminal's line length.)
- Add testfile -c switch for "commands verbose". Commands extra verbose or extra verbose causes all long commands to be dumped. Commands verbose without the other two causes EOS and seg change commands to be dumped, but long literals commands are hidden.
- Same optimisations as two of the ones for LZEXE depack.asm:
- Fix testfile mode, calculate "tag bits left" counter value from the cycle mask. This emulates the prior output without actually using the counter internally.
Interc3
- Do early check for sp size, checked later in process. This allows LZEXE's comtoexe to detect the minimum required memory block size.
- Add the E. of my initials and update some attribution years.
- Correct a typo in a comment.
- Use the hw reset retf in interrupt handlers as a trampoline to help debugging. In particular, lDebug's P command can work with the call near instruction now as the instruction immediately following this call is used as the trampoline instruction. (Prior to this the debugger would not re-gain control as expected.)
- Fix E comma in initials rather than E dot.
- Search path for application executable, and guess the filename extension (.COM or .EXE).
- doc: Update list item on path search.
- Update attribution year in pathshar.asm
- Pass the input command to interpre, not what the path search expanded it into.
- Fix to add 2-byte padding after the buffer for path search expansion. This is used for the executable's terminating NUL and the command line tail counter byte.
- Align the interpre.dat buffer to a paragraph boundary.
lDebug
- Add _DATEXE option to build depack.asm for inclusion in lzexedat utility.
- Enable lzexedat -l option by default for building compressed extpak.eld
- Do not create subdirectories for every help file when compressing the help using lzexedat -4, these were only needed for the temporary heatshrink files.
- Add _DXTAG option to depack.asm (same as for LZEXE).
- Fix for empty messages (in practice only msg.options_5) with lzexedat-packed help. The encoded string needed to be fixed, and the comparisons to detect an empty message had to be updated.
- Optimise initialisation of tag word by re-using get_bit:
- Store tag position as a cycle mask:
- Adjust pathshar.asm for use in INTERC3.
- Update attribution year in pathshar.asm
- In expr.asm support reg8+reg16 register pairs that form a 3byte (24-bit number).
- Update news-r10 with 3byte register pairs, document in varref the 3byte register pairs and also the register + "00" register pairs. (The 16-bit register + "00" pairs already had been supported for much longer, but not documented.)
You could leave a comment if you were logged in.
blog/pushbx/2025/0803_july/august_work.txt · Last modified: by ecm
