Well thanks to your considerable help I now have a source file that assembles albeeit with 10 Warnings regarding changed values on the 2nd Pass. I've checked out the byte values in those locations and the assembly is correct so a good result there. btw the -OP00/256*256+OP00 worked a treat. Those .BYTE lines showing as CMDERR-* and similar work fine left alone. I just removed the '?' and all assembles ok.
I've posted the modified asm listing in my public dropbox folder in case anyone would like a copy of it:- https://www.dropbox.com/s/l3gpkua9ynjyj ... 5.ASM?dl=0
Thanks again.
Paul
6502 Assemblers
Re: 6502 Assemblers
Great result - glad we were able to help.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 6502 Assemblers
bartleph wrote:
Well thanks to your considerable help I now have a source file that assembles albeeit with 10 Warnings regarding changed values on the 2nd Pass
During the assembler's first pass, it doesn't "know" that ZPADDR can be represented in eight bits, since the ZPADDR declaration has yet to be encountered. Hence assembly of the instruction defaults to a 16-bit operand in most 6502 assemblers. Later on, the ZPADDR declaration is encountered, but the assembler has already internally defined ZPADDR as a 16-bit value. The result is the instruction is assembled with absolute addressing with a warning, or a phase error is emitted and assembly is halted. The latter behavior is the more common one in two-pass assemblers. In contrast, a three-pass assembler will correct the instruction's operand to reflect the declaration, this occurring during the third pass. A warning is issued to let the programmer know about the correction.
It's good programming practice to declare zero page locations and other eight bit values before you use them. That way the assembler will "understand" your intentions.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 6502 Assemblers
Thank you so much for all your help and brilliant explanations chaps. It really does help to understand what is going on in order to get the right result.
KRs
Paul
KRs
Paul