ebiguy #1 Posted December 29, 2013 Hi everybody, I tried to use symbol U_LOAD of SpartaDos 4.46 to run another program but I don't understand how to deal with FLAG symbol. I don't see the solution in the documentation (translated by Google). Basically, I am doing something like this: ldy #0 lda #<executable_filename sta FILE_P,y iny lda #>executable_filename sta FILE_P,y sty FLAG jsr U_LOAD It does not run anything.Of course, all uppercase labels (FILE_P, FLAG and U_LOAD are binded at runtime). I can see the value in Altirra ($0CE3 for FILE_P,...) The filename is also correct. When I place in executable_filename a wrong filename I got an error. With a right filename, the call to U_LOAD returns but nothing is run. Maybe the problem is with FLAG symbol ? I am not sure about 1) the way to fill it and 2) the value to set to run the executable. I don't know if I should store something in FLAG or consider FLAG as a pointer and if I can/must change FLAG to point to a byte inside my program ? And which value to use (the doc says bit 7 should be cleared but what is the use of the other bits, if any) ? Thank you for your help. Quote Share this post Link to post Share on other sites
drac030 #2 Posted December 29, 2013 (edited) FLAG must be zeroed here, this selects the proper function of U_LOAD (i.e. load & execute). EDIT: also note that constructs like "lda #<some_address" are forbidden in a relocatable binary file. Example: ldx #$02 fn lda namep-1,x sta FILE_P-1,x dex bne fn stx FLAG jsr U_LOAD ... namep .word name name .byte 'FOOBAR.COM',$9b Edited December 29, 2013 by drac030 Quote Share this post Link to post Share on other sites
ebiguy #3 Posted December 29, 2013 Hi drac030, I put zero (was 1 with my previous code) and now it works ! I should have try it before posting...sorry. Thank you for your lightning fast answer !!! BTW, porgramming for SpartaDOs is a real pleasure. Using SpartaDos is just a new experience on the Atari. Many thanks to all SpartaDos contributors and keep up the good work. Bye. Quote Share this post Link to post Share on other sites