Cool! That's great sleuthing. I will implement those changes and try and feel my way along from there.
This has got to be the most convoluted Disk "API" ever invented. :-)
I think it works! I have a type 3 file, disk image with my boot files on it and it compiled them all on start up!
I spoke too soon of course. I have the new Classic99 version INI file set to type 3. :-)
But I have a direction now so it's all much better.
Your ideas were the same as Lee suggested with the exception that I was turning the card on in the Forth workspace, so I never set GPL R12 to the disk card address.
And I didn't turn the card off inside the GPL workspace either so it kept running.
So my method removes all the messy stuff of creating and manipulating the PAB data to Forth. I also scan the link list of devices in Forth and record the relevant data.
I don't search the entire list of devices because I know I only want disk card access at this time.
Here is what the code looks like now with your changes in CROSS-COMPILED Forth Assembler
There is a stub for and PANIC error handler but I will make that something meaningful.
Now I need to change it so I use the DSRWKSP to hold the parameters that I find in forth and then the GPL workspace can grab them from there.
\ workspace compile program address
\ --------- -----------------------
CREATE: DSKLNK DSRWKSP T, [cc] THERE TCELL + T, [tc]
837C @@ CLR, \ clr GPL status flag
83E0 LWPI, \ change to GPL workspace
R12 DSKCARD LI, \ card address -> GPL R12
RCODE @@ R9 MOV, \ RCODE has the ROM entry address
0 SBO, \ turn on the card
*R9 BL, \ branch to ROM code
@@1 JMP, \ on error DSR returns here
0 SBZ, \ on success turn off card
DSRWKSP LWPI, \ return to DSRWKSP
RTWP, \ Return to Forth Workspace
NEXT, \ run the Forth interpreter
@@1: 0 SBZ, \ TROUBLE! turn off card
DSRWKSP LWPI, \ to DSRWKSPACE
R0 INC, \ shows in the debugger
AGAIN, \ loop forever halts program
Edited by TheBF, Sat Oct 13, 2018 8:50 PM.