hello,
it seems I have lost my notes. I am sure I had done this some time ago.
Inside a machine code programm, I have sent the command LOAD"ProgName.BAS" and the disk sytem has loaded it succesfully.
Then the start adress is saved to $19 (usualyy $2401 for PCLEAR4 with disks)
The start+length is stored at $1B, $1D and $1F
Next $68-69 are set to $FFFF (direct mode)
Finally comes this:
JSR $83ED * ensure line links
JMP $841F * start Basic programm
But it doesn't start, despite when typed right on the green screen this works OK (EXEC&H841F always starts the loaded Basic programm)
I am sure that I am forgetting one or more system variables to be initialized, but wich ones?
Any advice will be greatly appreciated!
thanks in advance
regards
pere
Run a BAS program from within M/C
Re: Run a BAS program from within M/C
hello,
don't know if this is the best way to get it ...
I got a peek to the unassembled DragonDos 1.0 by P.Harvey-Smith
and copied as much instructions as could see there to run the just loaded BAS file.
A bit long, but it works for me ...
regards
pere
don't know if this is the best way to get it ...
I got a peek to the unassembled DragonDos 1.0 by P.Harvey-Smith
and copied as much instructions as could see there to run the just loaded BAS file.
A bit long, but it works for me ...
Code: Select all
FIN3 LDX #$FFFF
STX <$68
CLR <$F6
LDX <$19
JSR $85EE
LDX <$27
STX <$23
LDX <$1B
STX <$1D
STX <$1F
JSR $8514
JSR $8434
JMP $849F
pere
Re: Run a BAS program from within M/C
Is this after loading the program as a raw/ML file? (I do not know exactly what LOAD can do.)
Re: Run a BAS program from within M/C
hello Tormod,
this is part of the client I am building to load / run files from my Java VDK server.
It didn't work untill I have copied most of the code from the unassembled DOS1.0 (CmdLoad)
Now I can send the command RUN"LDREAM" and then Java sends back the basic program (LDREAM.BAS") which in turn is started by Dragon
Later one of the lines of the program sends a LOAD"DSKDREAM.BIN" that is served by the Java part, too.
And finally is executed. So, by now it works fine both for BAS and BIN file types.
There is a special case when the filename is not direct, say concatenation of strings and/or variables, for instance:
LOAD A$+"BIN" that by now gives an SN Error
I need to analize it deeper to get the whole string at the client before sending the command to the server ...
Isn't it nice programming?
regards
pere
this is part of the client I am building to load / run files from my Java VDK server.
It didn't work untill I have copied most of the code from the unassembled DOS1.0 (CmdLoad)
Now I can send the command RUN"LDREAM" and then Java sends back the basic program (LDREAM.BAS") which in turn is started by Dragon
Later one of the lines of the program sends a LOAD"DSKDREAM.BIN" that is served by the Java part, too.
And finally is executed. So, by now it works fine both for BAS and BIN file types.
There is a special case when the filename is not direct, say concatenation of strings and/or variables, for instance:
LOAD A$+"BIN" that by now gives an SN Error
I need to analize it deeper to get the whole string at the client before sending the command to the server ...
Isn't it nice programming?
regards
pere
Re: Run a BAS program from within M/C
The following method was often used for starting (auto-running) a BASIC program from machine code.pser1 wrote: Inside a machine code programm, I have sent the command LOAD"ProgName.BAS" and the disk sytem has loaded it succesfully.
Then the start adress is saved to $19 (usualyy $2401 for PCLEAR4 with disks)
The start+length is stored at $1B, $1D and $1F
Next $68-69 are set to $FFFF (direct mode)
Finally comes this:
JSR $83ED * ensure line links
JMP $841F * start Basic programm
But it doesn't start, despite when typed right on the green screen this works OK (EXEC&H841F always starts the loaded Basic programm)
I am sure that I am forgetting one or more system variables to be initialized, but wich ones?
Any advice will be greatly appreciated!
Code: Select all
JSR $841F ; BasVect1 - Sets up various vectors after a BASIC program has loaded.
JSR $83ED ; BasVect2 - Completes init.
JMP $849F ; RUN BASIC - Runs BASIC program in mem.
Re: Run a BAS program from within M/C
thanks Steve,
this works great too, and the most important it saves some bytes with respect to my best prior version.
regards
pere
this works great too, and the most important it saves some bytes with respect to my best prior version.
regards
pere