barrym95838 wrote:
I have used
https://www.sbprojects.net/sbasm/index.php version 2 for 6502 and 6800 projects ... but running python under Windoze for version 3 has been an annoying crap-shoot with mixed results for me (I probably don't know what I'm doing and I'm stumbling against some configuration issues I don't quite understand).
Currently I experiment with SBASM. It is a great tool indeed.
But I ran across strange issue. I need to calculate size of the table stored in EPROM and ten store that value in zeropage location. In ACME assembler for 6502 it is pretty straightforward task. All I need to do is:
Code:
LDA #<(CHARS_END-CHARS)
STA BLKLEN
LDA #>(CHARS_END-CHARS)
STA BLKLEN+1
Unfortunately it doesn't seem to work with SB ASM. It seems this asembler doesn't even like subtraction of labels in single line. So I defined additional .EQ definition:
Code:
CHARLEN .EQ CHARS_END-CHARS
It is calculated properly as 0x300 (size of a table). But unfortunately I wasn't able to move any further:
Code:
LDAA <CHARLEN
STAA BLKLEN+1
LDAA >CHARLEN
STAA BLKLEN
Causes:
Code:
*** Error: Out of range
308 LDAA <CHARLEN
And this code:
Code:
LDAA #<CHARLEN
STAA BLKLEN+1
LDAA #>CHARLEN
STAA BLKLEN
Ends up with:
Code:
*** Error: Bad Operand
308 LDAA #<CHARLEN
*** Error: Bad Operand
310 LDAA #>CHARLEN