I'm beginning to have fun with this. The MicroChess source code is loading into the OS65D Assembler/Editor and error prompts have allowed me to figure out (learn) the following:
* The MicroChess source code that is posted on 6502.org contains at least one opcode (PHY) that was part of the set of opcodes supported beginning with the 65C02. The OSI 6052 Assembler does not recognize PHY. Researching this a bit, it looks as if the workaround is to use the following opcodes together in this order TYA, PHA.
* The .Byte in the OSI assembler does not accept " (double quote marks), only single ' quote marks. Also, it appears that the number of operands or characters per line following .Byte is limited in number and must not have spacing between separating commas.
Here are two more novice questions as I go deeper into Assembly language:
1. Does it matter if the statements defining page zero variables and values come before or after the *=$nnnn that specifies where in memory the source code should be assembled?
2. The original 6502 source code for MicroChess that I'm working with put one *=$nnnn statement near the top of the source code and then placed another, second *=$nnnn statement near the end of the source code right before block data is defined in the form of a series of .byte statements. Is it necessary always to set this apparently separate memory location for block data? If so, are there specific requirements about memory spacing between opcodes and block data? (Okay, that is 3 questions).
Adapting Microchess 6502 assembly code to run on C8P
-
- Posts: 9
- Joined: Sat Aug 31, 2024 4:58 pm
-
- Posts: 105
- Joined: Tue May 30, 2023 8:53 am
Re: Adapting Microchess 6502 assembly code to run on C8P
Hi Tom,
here my suggestions to your project. Replacing PHY by "TYA, PHA" has to be done carefully, because TYA will ovewrite the content of the ACCU. PHY does not. There seems be also a PLY...
Variables can be specified before or after the *=$nnnn statement.
The *=$nnnn statement at the end of the code seems not to specify any special location in memory, where page boundaries have to be considered. So placing it directly after the code should be fine.
Have fun,
Thomas
here my suggestions to your project. Replacing PHY by "TYA, PHA" has to be done carefully, because TYA will ovewrite the content of the ACCU. PHY does not. There seems be also a PLY...
Variables can be specified before or after the *=$nnnn statement.
The *=$nnnn statement at the end of the code seems not to specify any special location in memory, where page boundaries have to be considered. So placing it directly after the code should be fine.
Have fun,
Thomas
-
- Posts: 9
- Joined: Sat Aug 31, 2024 4:58 pm
Re: Adapting Microchess 6502 assembly code to run on C8P
Okay, I'm back to working on getting the MicroChess 2.0 (written using 65C02) to under 65D on C1-C8. I've worked through various fixes to the source code that substitute for opcodes not available with the 6502 -- specifically PHY, PLY. Also figured out how to handle differences in characters-per-line limits under 65D compared to the limit on the platform used to prepare the MicroChess code.
When I run the A1 error check, I'm down to 4 lines with syntax errors (7), involving the following statements which the program uses as it paints the chessboard: LDA #'*' LDA #'-' LDA #'.' and LDA #'?' Interestingly, there seems to be no problem with the statement LDA #'|' I've been through the OSI Assembler reference manual and searched on 6502.org and other resources but am not finding definitive answers. One guess is that OSI assembler treats * - ? . as reserved for mathematical functions.
Before going further, I want to make sure that my use of page zero for slew of variables doesn't run afoul of any restrictions with the assembler under 65Dv3.3. For example, I see in the OSI Assembler reference manual that $AE - $B3 are used for the floating accumulator, so I suppose those should be off limits. Between $00 and $FF are there any other zero page addresses that are best not used for variable storage?
Thanks for help with these novice-level questions. Tom
When I run the A1 error check, I'm down to 4 lines with syntax errors (7), involving the following statements which the program uses as it paints the chessboard: LDA #'*' LDA #'-' LDA #'.' and LDA #'?' Interestingly, there seems to be no problem with the statement LDA #'|' I've been through the OSI Assembler reference manual and searched on 6502.org and other resources but am not finding definitive answers. One guess is that OSI assembler treats * - ? . as reserved for mathematical functions.
Before going further, I want to make sure that my use of page zero for slew of variables doesn't run afoul of any restrictions with the assembler under 65Dv3.3. For example, I see in the OSI Assembler reference manual that $AE - $B3 are used for the floating accumulator, so I suppose those should be off limits. Between $00 and $FF are there any other zero page addresses that are best not used for variable storage?
Thanks for help with these novice-level questions. Tom
-
- Posts: 460
- Joined: Thu Apr 16, 2015 2:27 pm
- Location: Bronx, NY USA
Re: Adapting Microchess 6502 assembly code to run on C8P
Try leaving off the closing single-quote (apostrophe). That is, for example, LDA #'- rather than LDA #'-'. If that doesn't work (though I think it will), you can use hex codes for those characters: *=$2A, -=$2D, .=$2E, and ?=$3F.
I ran into unexpected problems when I tried to assemble that Microchess file with the 65D Assembler; it looks like you have gotten further with it than I did.
The only zero page locations you need to avoid (I'm pretty sure) are $00 and $EF. It shouldn't matter that the code you are assembling uses some of the same zero-page locations as the Assembler itself, as they will not run at the same time.
I ran into unexpected problems when I tried to assemble that Microchess file with the 65D Assembler; it looks like you have gotten further with it than I did.
The only zero page locations you need to avoid (I'm pretty sure) are $00 and $EF. It shouldn't matter that the code you are assembling uses some of the same zero-page locations as the Assembler itself, as they will not run at the same time.