Hello all,
I've been looking at Bazz' tutorials (http://wiki.superfamicom.org/snes/show/ ... ES+Program) and had a question.
I ran the first.smc (which is included in the link at the bottom of the tutorial: http://wiki.superfamicom.org/snes/files ... program.7z) through the MESS emulator debugger and WLA is assembling the code incorrectly. I don't know if it's a coding error (likely) or if it's an actual bug in WLA (unlikely).
In the InitializeSNES method (which is in the InitSNES.asm source file) it is assembling the following two lines:
LDA #$0000 ;set Direct Page = $0000
TCD ;Transfer Accumulator to Direct Register
...into the following 3 bytes:
A9 00 5B
...when it should really be 4 bytes since the accumulator is in 16-bit mode:
A9 00 00 5B
The $5B value is actually the TCD opcode but it's being treated as the upper byte of the LDA instruction! I have included a screenshot for you.
I have also recompiled first.smc from scratch using the latest WLA binaries available here (viewtopic.php?f=12&t=12334) but the recompiled SMC has the exact same problem.
Does the source code need an extra assembler directive or something in order to tell WLA that the accumulator is in 16-bit mode?
Thanks!
I've been looking at Bazz' tutorials (http://wiki.superfamicom.org/snes/show/ ... ES+Program) and had a question.
I ran the first.smc (which is included in the link at the bottom of the tutorial: http://wiki.superfamicom.org/snes/files ... program.7z) through the MESS emulator debugger and WLA is assembling the code incorrectly. I don't know if it's a coding error (likely) or if it's an actual bug in WLA (unlikely).
In the InitializeSNES method (which is in the InitSNES.asm source file) it is assembling the following two lines:
LDA #$0000 ;set Direct Page = $0000
TCD ;Transfer Accumulator to Direct Register
...into the following 3 bytes:
A9 00 5B
...when it should really be 4 bytes since the accumulator is in 16-bit mode:
A9 00 00 5B
The $5B value is actually the TCD opcode but it's being treated as the upper byte of the LDA instruction! I have included a screenshot for you.
I have also recompiled first.smc from scratch using the latest WLA binaries available here (viewtopic.php?f=12&t=12334) but the recompiled SMC has the exact same problem.
Does the source code need an extra assembler directive or something in order to tell WLA that the accumulator is in 16-bit mode?
Thanks!