Jump to content

Photo

GPL relative branches?

GPL

6 replies to this topic

#1 ralphb OFFLINE  

ralphb

    Dragonstomper

  • 565 posts
  • Location:Germany

Posted Mon May 14, 2018 12:18 PM

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 ...



#2 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,671 posts
  • Location:Silver Run, Maryland

Posted Mon May 14, 2018 1:12 PM

I am pretty sure the address must be a direct value.  I do not think you can perform any indirection or indexing.

 

...lee



#3 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 565 posts
  • Location:Germany

Posted Mon May 14, 2018 1:22 PM

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?



#4 RXB OFFLINE  

RXB

    River Patroller

  • 3,017 posts
  • Location:Vancouver, Washington, USA

Posted Mon May 14, 2018 1:40 PM

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 by RXB, Mon May 14, 2018 1:42 PM.


#5 kl99 OFFLINE  

kl99

    Dragonstomper

  • 833 posts
  • Location:Vienna, Austria

Posted Tue May 15, 2018 5:53 AM

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.



#6 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 565 posts
  • Location:Germany

Posted Tue May 15, 2018 9:50 AM

 

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.



#7 kl99 OFFLINE  

kl99

    Dragonstomper

  • 833 posts
  • Location:Vienna, Austria

Posted Wed May 16, 2018 7:50 AM

i hope it works out. also never tried much in GPL so far.







Also tagged with one or more of these keywords: GPL

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users