Jump to content
ralphb

GPL relative branches?

Recommended Posts

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  [email protected](>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 ...

Share this post


Link to post
Share on other sites

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

 

...lee

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

 

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.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...