However, you may not want to rely on undocumented behavior. If the code could be run on an emulator, I don't think it's fair to expect an emulator have to replicate undocumented behavior.
Why not? If real hardware consistently produces same results and they happen to be undocumented, then they ...
Search found 10 matches
- Wed Jan 16, 2013 7:55 pm
- Forum: Programming
- Topic: processor detection
- Replies: 36
- Views: 8102
- Wed Jan 16, 2013 7:49 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
Faster, shorter, no decimal mode problems.
1536: PHA
1537: LDA #2 ;color value
1539: STA 53272 ;store color register
1542: CLD ;clear decimal mode
1545: ADC #2
1548: STA 1538 ;modify the code itself
1545: PLA
1546: RTI Lee.
That's just one made-up example. Most of the games/applications are ...
1536: PHA
1537: LDA #2 ;color value
1539: STA 53272 ;store color register
1542: CLD ;clear decimal mode
1545: ADC #2
1548: STA 1538 ;modify the code itself
1545: PLA
1546: RTI Lee.
That's just one made-up example. Most of the games/applications are ...
- Wed Jan 16, 2013 7:47 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
Hi AtariKSI, and welcome!
STZ direct is opcode $64. At http://visual6502.org/wiki/index.php?title=6502_all_256_Opcodes we learn that this is indeed a NOP on the NMOS 6502 - it is unspecified behaviour, but turns out to be a nop. It's a 3-cycle NOP and you'll see that there are some 2-cycle NOPs ...
STZ direct is opcode $64. At http://visual6502.org/wiki/index.php?title=6502_all_256_Opcodes we learn that this is indeed a NOP on the NMOS 6502 - it is unspecified behaviour, but turns out to be a nop. It's a 3-cycle NOP and you'll see that there are some 2-cycle NOPs ...
- Wed Jan 16, 2013 4:42 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
AtariKSI, I'm not familiar with the systems you're talking about but I'm a bit surprised that the ISRs don't clear the D flag if they need it clear. I can see your point though about saving the instruction time since they're interrupting 15,000 times a second on a 1MHz machine. But it does bring up ...
- Wed Jan 16, 2013 4:29 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
clockpulse wrote:
check this thread, there is some code posted, take a look at the first part, maybe that can be used for what you want to do.
- Wed Jan 16, 2013 4:26 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
The PLA and RTS are because this function is supposed to be called form BASIC, via something like A = USER(1536, B, C, D), where B, C, D are 16-bit integers passed on the stack. $D4 and $D5 are used to to set up the return value; see http://www.atariarchives.org/cfn/12/02/0091.php .
The original ...
- Wed Jan 16, 2013 1:12 am
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
I would enjoy learning how your proposed method functions, and discussing any pros & cons. It's true I'm not an Atari expert, and the same is true for a significant portion of the readership here. Would you still like to engage our interest as a group? This is a friendly bunch, and that's how we ...
- Tue Jan 15, 2013 10:59 pm
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
Re: STZ zp Opcode effect on various Retro-computers/consoles
Welcome AtariKSI.
I must say I find your proposed technique rather opaque, especially since you haven't included comments. As a courtesy, and since you're asking for assistance, it would be helpful if you were more informative.
Only code I wrote is "STZ 213" which is self-explanatory. And I did ...
I must say I find your proposed technique rather opaque, especially since you haven't included comments. As a courtesy, and since you're asking for assistance, it would be helpful if you were more informative.
Only code I wrote is "STZ 213" which is self-explanatory. And I did ...
- Tue Jan 15, 2013 10:42 pm
- Forum: Programming
- Topic: processor detection
- Replies: 36
- Views: 8102
Re:
However, you may not want to rely on undocumented behavior. If the code could be run on an emulator, I don't think it's fair to expect an emulator have to replicate undocumented behavior.
Why not? If real hardware consistently produces same results and they happen to be undocumented, then they ...
Why not? If real hardware consistently produces same results and they happen to be undocumented, then they ...
- Tue Jan 15, 2013 9:32 am
- Forum: General Discussions
- Topic: STZ zp Opcode effect on various Retro-computers/consoles
- Replies: 18
- Views: 2519
STZ zp Opcode effect on various Retro-computers/consoles
I wrote a 6502/65C02 cross assembler within MPDOS Pro (PC side) and wanted the fastest code to detect whether a 65C02 was present in any 6502 based system. On Atari 5200/800 systems, I have been able to test using this code:
$600: PLA
STZ 213
RTS
D=USR(1536) : REM call from BASIC and D returns ...
$600: PLA
STZ 213
RTS
D=USR(1536) : REM call from BASIC and D returns ...