ralphb Posted May 14, 2018 Share Posted May 14, 2018 Maybe I'm still dizzy, but I'm trying to write a small GPL program and for my life cannot figure out how to do relative jumps in GPL, like so: . B G@2(>8300) B G*>8300 B *>8300 . These are invalid syntax, though. So, what else? CASE is a bit unwieldy if the value is in the >1000s. I'm surprised I never noticed before ... Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted May 14, 2018 Share Posted May 14, 2018 I am pretty sure the address must be a direct value. I do not think you can perform any indirection or indexing. ...lee Quote Link to comment Share on other sites More sharing options...
ralphb Posted May 14, 2018 Author Share Posted May 14, 2018 So have people figured something out as a workaround? If it were GRAM, you could put the word for "B" and the target in two consecutive words, and jump to the "B". But in GROM? Quote Link to comment Share on other sites More sharing options...
RXB Posted May 14, 2018 Share Posted May 14, 2018 (edited) Page 3-7 of the TI GPL Programmers Manual THERE IS NO INDEX ADDRESSING OF GROM/GRAM You can index RAM or VDP but not GROM/GRAM. GROM was never written so it could "SELF MODIFY AN ADDRESS" like Assembly does, hence no version was ever created to do so. You can reference: Ryte Data GPL Assembler RAG GPL Assembler Swedish GPL Assembler TI GPL Assembler And a couple others but none allow this. Edited May 14, 2018 by RXB Quote Link to comment Share on other sites More sharing options...
kl99 Posted May 15, 2018 Share Posted May 15, 2018 So have people figured something out as a workaround? If it were GRAM, you could put the word for "B" and the target in two consecutive words, and jump to the "B". But in GROM? Can you calculate the absolute address inside your program and write the result into a Register and use that to branch to? Isn't the current GROM program location stored in Scratch Pad RAM ? You could read out that value in your beginning of your program to figure out from which memory location your Gpl is currently executed and calculate the offset from there. 1 Quote Link to comment Share on other sites More sharing options...
ralphb Posted May 15, 2018 Author Share Posted May 15, 2018 Can you calculate the absolute address inside your program and write the result into a Register and use that to branch to? Yes, this is what I'm doing to branch from the FG99 assembly menu to the loaded GROM program. This works quite well (see FG99 code after the XORG). I never tried this within GPL, but it could work, even though you're messing with the running GPL interpreter. 1 Quote Link to comment Share on other sites More sharing options...
kl99 Posted May 16, 2018 Share Posted May 16, 2018 i hope it works out. also never tried much in GPL so far. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.