I am confused when i use "stz" to clear memory that located in zero page in w65c02s instruction sets.
first I defined
year equ e4h
then .......
stz year
the confusion appeared.after compiled,the instruction opcode is "9c e5 00" rather than "64 e5"that i think reasonable.So when the program runs to this step stop will inevitably happen and notify "Error instruction (opcode)at address ....".But even the exactly same intruction sometimes is compiled normally and other times abnormally.
certainly,if using "lda ...,sta ..."replace it ,compiling process is ok,I don't understand why this happened.
what is wrong with "stz" on earth?
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Which assembler and emulator are you using? We might be able to help if you give us some more information.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
The original message hints at two different problems.
1. Even though the 'year' constant is in the $00-$FF range the poster indicates that his assembler is generating an absolute rather than zero-page instruction.
This suggests assembler in use is in error or some other factor not visible in the short code sample is misdirecting the assembler.
2. The code appears to be being executed in some kind of emulator that does not support 65C02 opcodes. If this is the case then the poster should stick to the 6502 opcode set and configure his assembler to reject extended instructions.
More information about the assembler and emulator in use might help determine what is going on here.
1. Even though the 'year' constant is in the $00-$FF range the poster indicates that his assembler is generating an absolute rather than zero-page instruction.
Quote:
the confusion appeared.after compiled,the instruction opcode is "9c e5 00" rather than "64 e5"
2. The code appears to be being executed in some kind of emulator that does not support 65C02 opcodes. If this is the case then the poster should stick to the 6502 opcode set and configure his assembler to reject extended instructions.
Quote:
So when the program runs to this step stop will inevitably happen and notify "Error instruction (opcode)at address ....".
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
-
chenxiaohua1111
- Posts: 3
- Joined: 27 Dec 2004
maybe it is a problem of assembler
firstly thank you all.
basically,I know the difference of "64.." and "9c..." that generated from "STZ", and then that is my point I don't understand. "STZ YEAR" there should be correspondant to "64.."not "9c.."and so I think it is my assembler's fault.
The assembler i am making use, i think, may be not familiar to you.The IC , manufactured in taiwan, just use 6502 core and then use their own assembler.So I am not very confident to the assembler.
basically,I know the difference of "64.." and "9c..." that generated from "STZ", and then that is my point I don't understand. "STZ YEAR" there should be correspondant to "64.."not "9c.."and so I think it is my assembler's fault.
The assembler i am making use, i think, may be not familiar to you.The IC , manufactured in taiwan, just use 6502 core and then use their own assembler.So I am not very confident to the assembler.