So in the case of Stratego, the main game program is chain-run after the setup program is done. If the main program is in 2 segments, how would I go about loading it from the setup program?
Also, would you mind posting the actual assembly code for the CALL LOAD statement so I can better understand how you do this?
What I envision is the low memory code saved as an XB program - let's say "PROGRAM1". The high memory code is saved as "PROGRAM2"
Your setup program does this: "RUN "DSK1.PROGRAM1". Program1 is a 1 line program:
10 CALL LOAD(8192,32,8)::CALL LINK("X")::RUN "DSK1.PROGRAM2"
with an XB program of up to 8K stored as embedded code.
This program is loaded into high memory and the AL sub at >2008 copies the embedded XB code to low memory. When the sub has done this it returns to XB and the program then loads and runs Program2. The first line in Program2 does an AL sub that finds the line number table for the XB code in low memory and merges that with the line number table for the XB program in high memory. The program would then probably have to run itself again so the prescan has been done properly. At this point the program runs normally but with up to 32K of code available. This utility does not exist yet, but the concept is simple enough.
The CALL LOAD statement sets >8330 (start of line number table), >8332 (end of line number table), >8384 (highest address in exp memory), >8386 (highest free address in memory exp) This fools XB into loading the program into low memory. This may be useful to whoever decides to implement this idea.
Edited by senior_falcon, Sun Feb 17, 2019 1:12 PM.