|
Post by stiggity on Aug 3, 2020 0:33:43 GMT
Greetings: I'm still developing my 128 project, and have run into a snag.... lets say were at line# 1000 in BASIC at an ML input routine. If a certain key's pressed, another ML program is loaded at $b000 and it execute its sole purpose, until another special key is pressed, then I'm trying to get the code @ $bxxx to perform a GOTO, to the last BASIC line#/token that BASIC was running??? Everything is working, except the goto, or some means to get back to the BASIC interpreter, or another line at the first ML input routine? Am I asking too much?
|
|
|
Post by bjonte on Aug 3, 2020 15:29:05 GMT
Doesn’t BASIC continue after the SYS command where it left off when returning from the machine language code?
|
|
|
Post by stiggity on Aug 3, 2020 19:11:07 GMT
Im calling a routine that gets loaded, and for some reason, all of my attempts to RTS/JMP back to the call that loads the module, breaks to monitor. And my assembler skills are poor, but debugging via the c128 monitor... im even worse.
|
|
|
Post by gsteemso on Aug 3, 2020 20:25:48 GMT
It's been quite some time, but if simply using GOSUB and RETURN isn't helping... wasn't there something about GOTO [variable]? I do know the older BASIC constructs originally meant for dynamic program flow (specifically GOTO [constant] and ON [variable] GOTO) aren't always suitable.
|
|
|
Post by gsteemso on Aug 3, 2020 20:28:42 GMT
sorry, I'd misread the question & failed to catch the part where you were starting from an assembly-language subroutine. Is this in the best subforum for that?
|
|
|
Post by remark on Aug 4, 2020 19:34:29 GMT
Are you sure BASIC is in context when you return from your ML routine? To execute code at $b000 , you need to switch off the BASIC ROM.
|
|
|
Post by stiggity on Aug 4, 2020 23:30:09 GMT
remark!! Aye, any way you could share how to bank basic rom back to it's default bank? This seems like a probable cause..
|
|
|
Post by stiggity on Aug 4, 2020 23:35:37 GMT
remark: you're right! i preserved the value @ $ff00, then stored a $0e, jsr to code, rts, PLA, sta $ff00, rts and it worked like a charm!!!!! Sheesh.. i'll tell ya... sometime learning, can be totally doable..
|
|