Date : Fri, 07 Jun 1985 10:34:47 PDT (Fri)
From : Bridger Mitchell <bridger@rand-unix.ARPA>
Subject: Why WordStar can't Run ...
... some bios-calling programs.
The WordStar "R" (run) command protects high memory, installs a program
loader there, and attempts to load the requested COM file.
Before doing so it copies the system bios jump vector to that area, sets
warmboot and bdos function 0 traps, and changes 0001h to point to the
warmboot entry in this new vector.
This causes at least two problems for some software:
1. The new vector is NOT aligned on a page boundary. Many (most?)
applications software assumes the bios vector is aligned, and
call a bios function by code such as:
lhld 1
mvi l,9 ;bios conin function
pchl
To work with WS the code needs to do the arithmetic:
lhld 1
mvi a,9-3
add l
mov l,a
jnc pchl1
inr h
pchl1: pchl
2. By changing 0001, WS has broken the (unwritten?) rule that the system's
addresses can be determined at runtime. WS's loader overlay should,
instead, patch itself into the warm-boot chain at the bios warmboot address.
That way, resident system extensions and other software that needs to locate
the system will be able to function under "R". About the best the
applications program that needs this information can do is to search for a
string of jmps that begin on a page boundary (taking care to note that some
bios's replace jmps with in-line code for a few entries).
I looked into this after a user noted that some DateStamper utilities
wouldn't run inside WS. The new versions do, now. But I imagine there are a
lot of our PD utilities that don't. Perhaps revisors could keep this in mind
as versions get updated.
--bridger mitchell