: This process is complex, because we first assemble the emulator with 0
: area for user programs, in order to find the size of the emulator, and
: then re-assemble and load with the emulator moved up to its maximum
: size.
echo assemble and load:
assemble nospace
ld -X lib/a? lib/*.o -lc -la
if ! -r a.out exit
size a.out^tee /tmp/adj$$
ed - /tmp/adj$$
s/.*[( ]//
s/[)b]//
s;.*;/EMUSIZE/s/=.*/=&/;
0a
ed - assem0.s
g/LOADHI=/s/0/1/
.
$a
w
q
.
w
q
sh /tmp/adj$$
rm /tmp/adj$$
assemble nomod
ld -X lib/a? lib/*.o -lc -la
