Jump to content
Sign in to follow this  
Gorf

Main code rules as requested by others.

Recommended Posts

To jump around in main RAM.....

 

1 ) Within a 256 byte page boundary...ie..The address range of a page starts at $XXXXXX00 and ends at $XXXXXXFF.

 

a ) JR can jump from anywhere to anywhere within its range and inside the page.

b ) JUMP must be aligned on a long address and jump to a word offset long address...ie...adresses ending in 2,6,A and E

 

2 ) From one 256 byte page to another

 

a ) JR (if it can reach the destination) can jump from anywhere but MUST land on a long aligned address to the other page.

b ) JUMP must be aligned on a long address and jump to a long aligned address...ie...adresses ending in 0,4,8 and C.

 

3 ) To jump from main to local or local to main(from one way to the other is the same).

 

a ) The JUMP must be long aligned. The desination must be long aligned. However, phrase aligment is reccomended for saftey.

b ) Preceed the JUMP with a MOVEI not related to the JUMP register(although I've had success with, Owl says its not safe.)

c ) Obviously JR can not reach main RAM from the GPU local address so it will not work for this

 

JR/JUMP must be followed by 2 NOP's OR 1 single register instruction not associated with anything recent and then NOP.

I do not think the single instruction and 1 NOP will work between local to main

or main to local but I'll leave that up to Owl to answer.

  • Like 1

Share this post


Link to post
Share on other sites

Somehow i missed this and replied in the main forum thread.

 

 

a ) The JUMP must be long aligned. The desination must be long aligned. However, phrase aligment is reccomended for saftey.

b ) Preceed the JUMP with a MOVEI not related to the JUMP register(although I've had success with, Owl says its not safe.)

c ) Obviously JR can not reach main RAM from the GPU local address so it will not work for this

 

JR/JUMP must be followed by 2 NOP's OR 1 single register instruction not associated with anything recent and then NOP.

I do not think the single instruction and 1 NOP will work between local to main

or main to local but I'll leave that up to Owl to answer.

Its good to see the rules laid out again :)

 

To comment on specifics...

  • The preceding MOVEI can be the jump register or an independent register - i often use the jump register.
  • I've also used the single register instruction plus 1 NOP for jumps between local & main.

Even following the guidelines there can STILL be unexpected difficulties with Main/Local jumps if the jump to/from occurs many times in quick succession - try to space out the jumps as much as possible. My own code only jumps between main & local <5,000 times a second atm.

Edited by Atari_Owl

Share this post


Link to post
Share on other sites

Somehow i missed this and replied in the main forum thread.

 

 

a ) The JUMP must be long aligned. The desination must be long aligned. However, phrase aligment is reccomended for saftey.

b ) Preceed the JUMP with a MOVEI not related to the JUMP register(although I've had success with, Owl says its not safe.)

c ) Obviously JR can not reach main RAM from the GPU local address so it will not work for this

 

JR/JUMP must be followed by 2 NOP's OR 1 single register instruction not associated with anything recent and then NOP.

I do not think the single instruction and 1 NOP will work between local to main

or main to local but I'll leave that up to Owl to answer.

Its good to see the rules laid out again :)

 

To comment on specifics...

  • The preceding MOVEI can be the jump register or an independent register - i often use the jump register.
  • I've also used the single register instruction plus 1 NOP for jumps between local & main.

Even following the guidelines there can STILL be unexpected difficulties with Main/Local jumps if the jump to/from occurs many times in quick succession - try to space out the jumps as much as possible. My own code only jumps between main & local <5,000 times a second atm.

 

 

The only time I jump to local is after I do the grunt work out in main so I never experienced this....yet.

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.
Note: Your post will require moderator approval before it will be visible.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...