supercat Posted June 3, 2005 Share Posted June 3, 2005 lda $80,y Should throw up an "Illegal Addressing Mode" error. I've seen different 6502 assemblers handle this issue differently. My preferred approach is to have four-letter mnemonics which explicitly specify zero-page or non-zero-page addressing, and otherwise have the addressing mode be inferred based upon the numerical value of the operand. Trying to use the way in which the operand is written to make such inference can be dangerous unless the assembler distinguishes among eight-bit labels, sixteen-bit labels, and numeric quantities. For example, suppose I write the following: foo equ $FF bar equ foo+1 lda (bar-1) What addressing mode should be generated? BTW, I would suggest that when coding for the Atari, a good way to address the TIA or RAM using absolute addressing mode would be to simply add 256 to the address, since addresses $0100-$01FF map to $0000-$00FF. Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 3, 2005 Share Posted June 3, 2005 My preferred approach is to have four-letter mnemonics which explicitly specify zero-page or non-zero-page addressing, and otherwise have the addressing mode be inferred based upon the numerical value of the operand. DASM can use modifiers like .w, .wx, .wy. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.