snarf2888 wrote:And tokumaru says I can define `.org` as "organize"
Although, I've looked at other assemblers, which ones define it as "origin", out of curiosity?
Probably just about every single one of them, including emulators for architectures other than 6502. Google
assembly org origin returns
this page, for example.
I'm curious why indirection brackets () conflicts with mathematical brackets on some assemblers but not others? Or are they separate for clarity reasons?
I imagine it makes the parser simpler. Just matching
lda (some_arbitrary_string),Y won't work; you have to match
lda (some_full_expression),Y, which means it has to be applied after the stage of the parser that recognizes expressions. And the expression part of the parser has to be smart enough not to swallow the outermost parentheses.
Code: Select all
; These should assemble the same way, using aaaa,Y addressing mode
lda 3*4+2*5,Y
lda (3*4)+(2*5),Y
; This should assemble differently, using (dd),Y addressing mode
lda (3*4+2*5),Y
Perhaps the author of the MagicKit assemblers (PCEAS and NESASM) thought brackets would simplify the parser and wasn't considering the francophone minority, as more developers were in Japanese- or English-speaking countries when the TG16 and NES were popular.
The other issue is that the 65816 uses brackets for "indirect long" addressing modes, which use the data bank in the pointer instead of the data bank from the data bank register.
Pokun wrote:Non-automatic zeropage addressing could be annoying if one needs to move lots of variables from the zeropage.
This feature arises from MagicKit's early focus on the HuC6280, the CPU of the TG16. Its direct page is at $2000-$20FF instead of $0000-$00FF. The direct page of the SPC700 (Super NES audio CPU) is at $0000-$00FF or $0100-$01FF depending on P bit 5. The direct page of the LR35902 (Game Boy CPU) is at $FF00-$FFFF, though that one's based on an 8080 rather than a 6502. And the direct page of the 65816 can be moved to start at any location in bank 0 ($000000-$00FFFF), though if direct page doesn't start on a 256-byte boundary, each direct page instruction incurs an extra cycle of index addition penalty.
On the HuC6280, for example, which address should
lda $02 read? Should it read $0002 in absolute mode? Or should it read $2002 in direct page mode?