SX Code Space and Pages
Hello,
I have not been programming the the SX for very long. I have hit a small
snag in my current project and I thought maybe someone here had encountered
this sort of thing before. I understand that the SX Microcontroller has a page size
so that code must be split up in 512 word sections. Further more the PBASIC language
seems to handle this automatically and that when programming in assembly the
responsibility lies on the programmer. My issue is that my code is primarily in PBASIC,
but I am using Assembly at the bottom of the file in several subfunctions. I have a senario
now that when I add more lines to my code in the top part of the file it starts screwing
with the assembly in the subfunctions. I read in the documentation that the jmp instructions
are effected and can lead to erratic behavior. If anyone has encountered this before please
let me know how you solved the problem.
Thanks,
Miles
I have not been programming the the SX for very long. I have hit a small
snag in my current project and I thought maybe someone here had encountered
this sort of thing before. I understand that the SX Microcontroller has a page size
so that code must be split up in 512 word sections. Further more the PBASIC language
seems to handle this automatically and that when programming in assembly the
responsibility lies on the programmer. My issue is that my code is primarily in PBASIC,
but I am using Assembly at the bottom of the file in several subfunctions. I have a senario
now that when I add more lines to my code in the top part of the file it starts screwing
with the assembly in the subfunctions. I read in the documentation that the jmp instructions
are effected and can lead to erratic behavior. If anyone has encountered this before please
let me know how you solved the problem.
Thanks,
Miles
Comments
- use @ with all jumps in assembly. This forces the page and the jump to be set. E.g.:
- use an ORG (address) statement to ensure that all ASM in a routine is in one page w/o crossing page boundaries:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
You have really helped me get a grasp on this thing.