Gorf Posted June 25, 2010 Share Posted June 25, 2010 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. 1 Quote Link to comment Share on other sites More sharing options...
Atari_Owl Posted June 26, 2010 Share Posted June 26, 2010 (edited) 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 June 26, 2010 by Atari_Owl Quote Link to comment Share on other sites More sharing options...
Gorf Posted June 27, 2010 Author Share Posted June 27, 2010 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. 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.