@cgracey - the problem we have is that TAQOZ relocates to first 64k but while in TAQOZ a ^D only ends up using a relative jump to Cluso's debugger (can we refer to it simply as LSD ) but we were modifying the version of LSD in ROM so nothing happened. Looking at the machine code showed that the jump was relative but we had mistakenly thought that the @ would give us an absolute address but now we know it always refers to the hub address and we need to use \ to force absolute address or \@ for both. But we don't have an operator symbol to force relative although by default it looks like it does this.
In some other assembly languages the # forces absolute mode and @ relative but the Prop has register addressing by default so the # is used to force a jump to immediate address which means we can't use this symbol for absolute vs relative.
Maybe we could use:
@ Force absolute hub address
\ Use absolute address (cog or hub)
~ Try to use relative address but issue warning if out of range.
@"Dave Hein" - Is p2asm something I can run on my system as I like having a real listing? Is there source available that we can enhance?
I just want to point out that we've had roughly the same conversation several times over the last year or two. I think it's an indication that the current syntax is confusing and hard to remember. Is there an alternative syntax we could use that's more understandable, even if it isn't as terse?
I just want to point out that we've had roughly the same conversation several times over the last year or two. I think it's an indication that the current syntax is confusing and hard to remember. Is there an alternative syntax we could use that's more understandable, even if it isn't as terse?
I don't know. I think the set of cases that Cluso put up and the revamping I made to it spells it out pretty well. There are just a few concepts to grasp. The complexity stems from the difference between cog and hub ram and their address spaces.
@cgracey - the problem we have is that TAQOZ relocates to first 64k but while in TAQOZ a ^D only ends up using a relative jump to Cluso's debugger (can we refer to it simply as LSD ) but we were modifying the version of LSD in ROM so nothing happened. Looking at the machine code showed that the jump was relative but we had mistakenly thought that the @ would give us an absolute address but now we know it always refers to the hub address and we need to use \ to force absolute address or \@ for both. But we don't have an operator symbol to force relative although by default it looks like it does this.
In some other assembly languages the # forces absolute mode and @ relative but the Prop has register addressing by default so the # is used to force a jump to immediate address which means we can't use this symbol for absolute vs relative.
Maybe we could use:
@ Force absolute hub address
\ Use absolute address (cog or hub)
~ Try to use relative address but issue warning if out of range.
@"Dave Hein" - Is p2asm something I can run on my system as I like having a real listing? Is there source available that we can enhance?
Maybe there is a better way.
Relative is what you'd want in most cases, but sometimes you need absolute addressing, in both intra-cog and intra-hub code.
We've though about stripping the '#' from immediate addresses, but it causes other subtle confusion. I'd like '@' for relative, in place of '#', but '@' is our address-of operator in Spin.
Comments
In some other assembly languages the # forces absolute mode and @ relative but the Prop has register addressing by default so the # is used to force a jump to immediate address which means we can't use this symbol for absolute vs relative.
Maybe we could use:
@ Force absolute hub address
\ Use absolute address (cog or hub)
~ Try to use relative address but issue warning if out of range.
@"Dave Hein" - Is p2asm something I can run on my system as I like having a real listing? Is there source available that we can enhance?
Thanks David, that was as easy as pie. I assembled a simple spin2 file but my ROM code doesn't. Guess I need to RTM
It might be because I am addressing 1MB of memory with the ROM at $FC000......
I don't know. I think the set of cases that Cluso put up and the revamping I made to it spells it out pretty well. There are just a few concepts to grasp. The complexity stems from the difference between cog and hub ram and their address spaces.
Maybe there is a better way.
Relative is what you'd want in most cases, but sometimes you need absolute addressing, in both intra-cog and intra-hub code.
We've though about stripping the '#' from immediate addresses, but it causes other subtle confusion. I'd like '@' for relative, in place of '#', but '@' is our address-of operator in Spin.
keep it simple and readable.
JMPA jumps absolute
JMPR jumps relative
and if JMPR is not possible because of crossing boundaries the compiler uses absolute and gives a warning/error?
DJNZA /DJNZR does not look bad either.
but DJNZ #\@.loop
looks more like if someone is swearing in a comic book
Mike
EDIT: Removed a totally wrong understanding.