HUB ram below $400 and in ROM area
msrobots
Posts: 3,709
in Propeller 2
I am sort of confused about the current use of HUB memory below $400. As far as I can follow jmps/calls below $400 use LUT ram, below $200 COG ram and above that HUB exec.
But HUB exec does not need to be aligned to longs, so one can HUB exec code on odd addresses for example. Is this still true for HUB exec below $400, so can one call odd addresses in HUB below $400 or is that not true anymore?
Would it make sense to use the same method done on the P1 to save current clock settings of the P2 in the first locations? Or could there be some memory location in the upper ram(rom) that could be used for this?
Is there still a way to write protect the ROM area and unprotect it again or is that not true anymore?
curious,
Mike
But HUB exec does not need to be aligned to longs, so one can HUB exec code on odd addresses for example. Is this still true for HUB exec below $400, so can one call odd addresses in HUB below $400 or is that not true anymore?
Would it make sense to use the same method done on the P1 to save current clock settings of the P2 in the first locations? Or could there be some memory location in the upper ram(rom) that could be used for this?
Is there still a way to write protect the ROM area and unprotect it again or is that not true anymore?
curious,
Mike
Comments
But, and that is still true in principal ... but the detail of what an increment of one actually is and what the cut-off address is has become more murky for me of late. Two things have happened that makes me think it needs a little investigating:
- I remember Cluso stating that the cut-off is $1000, not $400. At the time I corrected him. Now, I'm not so confident. Because just the other day I discovered:
- The machine coded addresses for cog/lutexec (at least) are padded with %00 for the two lsbits. Meaning a branch to, say $120, is coded as $480. This is cogexec running from cogram.
It's almost like Pnut is lying about addresses. When the common directive of ORGH $400 is issued, is that actually loading the code to $400 in hubram?
I haven't thought to question it until now.
Write protect control is in the HUBSET instruction. Documented in the google doc.
Ah, this might only be true for the 20-bit immediate address encoded in those special instructions ...
EDIT: Bah! That wouldn't change anything. A jump to encoded address $480 is still inside cogram. How can anything below $1000 be hubexec?
PNut should assemble hub-to-hub references as relative. Same with cog-to-cog. Only when crossing cog/hub does it default to absolute addressing.
JMPREL is intended for JMP tables.
It's really meant to be used with a variable. If you use #label, it will assemble that label's value. There is really no use for an immediate in that instruction, but I allowed it because the hardware allows it. On the other hand, it could be convenient to do 'JMPREL #4' to jump over four instructions.
Ah, I think I've solved it. In cogram, the relative addresses are different scale to absolute! And this doesn't matter for the purposes of overlap because relative is never used to cross the boundary.