Is there a way to force HUB memory alignment?
dnaddor
Posts: 26
Hi everyone.
I have several graphic tiles in DAT sections. Each tile is 16 longs (64 bytes). I am using the lower 6 bits of pointers for something else, so I want to force the first block to be at a hub address that is a multiple of 64. In other words, I need to reserve between 0 and 63 bytes to force the first block to be at the correct spot.
Right now, I'm putting the tiles as the very first DAT block at the very beginning of my program, and then putting a long 0,0,0 in front. According to [noparse][[/noparse]F8], my graphic tiles start at hub memory address $0040, so the code works. But I'm concerned that the IDE might rearrange how it lays out the hub memory, or that an IDE update will change where the data lives.
Is there a better way to do this? Something like ORG (($ + 63) & 63), but for hub memory?
Thanks!
I have several graphic tiles in DAT sections. Each tile is 16 longs (64 bytes). I am using the lower 6 bits of pointers for something else, so I want to force the first block to be at a hub address that is a multiple of 64. In other words, I need to reserve between 0 and 63 bytes to force the first block to be at the correct spot.
Right now, I'm putting the tiles as the very first DAT block at the very beginning of my program, and then putting a long 0,0,0 in front. According to [noparse][[/noparse]F8], my graphic tiles start at hub memory address $0040, so the code works. But I'm concerned that the IDE might rearrange how it lays out the hub memory, or that an IDE update will change where the data lives.
Is there a better way to do this? Something like ORG (($ + 63) & 63), but for hub memory?
Thanks!
Comments
I love the extra 63 byte idea. The program can figure out how far to move the data, and just move it at initialization.
Thanks for the quick reply.