antron Posted October 23, 2005 Share Posted October 23, 2005 (edited) when the stack pointer is pointing to the first byte of ram, what value is actually in the stack pointer? $00 or $80? (is it the actual location or an offset from $80?) if it is an offset, what is the affect of setting the most significant bit to 1? would %10000000 also point to the first byte in ram? or into that mirrored TIA address space that is right after the RAM? TIA Edited October 23, 2005 by antron Quote Link to comment Share on other sites More sharing options...
supercat Posted October 23, 2005 Share Posted October 23, 2005 when the stack pointer is pointing to the first byte of ram, what value is actually in the stack pointer? $00 or $80? Stack pointer values of $00-$7F point to the TIA. Quote Link to comment Share on other sites More sharing options...
Kroko Posted October 23, 2005 Share Posted October 23, 2005 when the stack pointer is pointing to the first byte of ram, what value is actually in the stack pointer? $00 or $80? If you want the stack pointer to point to VCS memory location $80, then you have to write $80 to SP. (is it the actual location or an offset from $80?) Don't get confused. It is just an ordinary pointer. It points to the adress thats is in it. Nothing special here. if it is an offset, what is the affect of setting the most significant bit to 1? would %10000000 also point to the first byte in ram? It is not an offset and you access the adress that it points to. So you will access the TIA if the MSB is 0 and RAM if the MSB is 1 Quote Link to comment Share on other sites More sharing options...
antron Posted October 23, 2005 Author Share Posted October 23, 2005 (edited) I see. Thanks. that actually works out in my favor. in a kernel that will run 16 times, i was keeping a linecount in y to do two indexed reads from ram and two indirect indexed reads from rom (pointing to the right 32 byte chunk in rom). now i can keep the linecount in the stack pointer. transfer it to x, and then mask the upper three bits of x (with sax: and x with a, store in x, 2 cycles) to make indexed reads from the right chunk of rom (and i need all 3 bits). you can't set bits with lda, sax but you can turn them off. (i could txa, ora, tax but i need those 2 extra cycles) i just have to keep my indexed ram data at the end of ram, and pull it. now all my linecount overhead is gone, and i come out 3 cycles ahead at the end of the day (i had to store it in a temp because there is a point that i need all three registers to change three colors in 9 cycles) thanks again Edited October 23, 2005 by antron 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.