From 12128258555aff2940598d5ed444af5da435a599 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Tue, 16 Jul 2024 22:39:23 -0700 Subject: [PATCH] Update and cross-check opcode data --- src/Ophis/Opcodes.py | 2 +- src/tools/opcodes/README.md | 5 +++++ src/tools/opcodes/op4502.txt | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/tools/opcodes/README.md diff --git a/src/Ophis/Opcodes.py b/src/Ophis/Opcodes.py index 87b4388..8b5ece0 100644 --- a/src/Ophis/Opcodes.py +++ b/src/Ophis/Opcodes.py @@ -359,7 +359,7 @@ csg4502extensions = { 0x79, None, None, None, None, None, 0x61, 0x71, None, 0x72, None, None, None], 'and': [None, 0x29, None, 0x25, 0x35, None, 0x2D, 0x3D, 0x39, None, None, None, None, None, 0x21, 0x31, None, 0x32, None, None, None], - 'asr': [0x43, None, None, None, 0x54, None, None, None, + 'asr': [0x43, None, None, 0x44, 0x54, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], 'asw': [None, None, None, None, None, None, 0xCB, None, None, None, None, None, None, None, None, None, None, None, None, None, None], diff --git a/src/tools/opcodes/README.md b/src/tools/opcodes/README.md new file mode 100644 index 0000000..3643bc2 --- /dev/null +++ b/src/tools/opcodes/README.md @@ -0,0 +1,5 @@ +This directory holds the definitive instruction lists for all supported architectures. The `gensets.py` program generates the Opcodes file from the text files here. To fix bugs or gaps in the ISAs, or to introduce new ones, edit or extend this directory in preference to directly updating `Opcodes.py`. + +The opcode information for the 6502 and 65c02 match the information in the reference manual _Programming the 65816: Including the 6502, 65C02 and 65802_ by David Eyes and Ron Lichty. The opcode information for the 4502 largely matches version 0.9 of Michael Steil's _Commodore Semiconductor Group CSG65CE02 Technical Reference,_ with the exception of the `INW` and `DEW` instructions, which are incorrectly or inconsistently marked as Absolute mode instructions. They are currently understood by C65-related project workers as being Zero Page. This includes the 65CE02 docs included with the VICE project. + +The "Undocumented 6510 Opcodes" match the descriptions and usage in the documentation for the VICE emulator, which also seem to follow traditional practice. diff --git a/src/tools/opcodes/op4502.txt b/src/tools/opcodes/op4502.txt index ac01ee7..73f8df9 100644 --- a/src/tools/opcodes/op4502.txt +++ b/src/tools/opcodes/op4502.txt @@ -66,7 +66,7 @@ 41: EOR - (Zero Page, X) 42: NEG - Implied 43: ASR - Implied - 44: ASR Zero Page + 44: ASR - Zero Page 45: EOR - Zero Page 46: LSR - Zero Page 47: RMB4 - Zero Page @@ -193,7 +193,7 @@ C0: CPY - Immediate C1: CMP - (Zero Page, X) C2: CPZ - Immediate - C3: DEW - Zero Page + C3: DEW - Zero Page # Docs inconsistent on mode C4: CPY - Zero Page C5: CMP - Zero Page C6: DEC - Zero Page @@ -225,7 +225,7 @@ E0: CPX - Immediate E1: SBC - (Zero Page, X) E2: LDA - (Zero Page, SP), Y - E3: INW - Zero Page + E3: INW - Zero Page # Docs incorrectly call this Absolute E4: CPX - Zero Page E5: SBC - Zero Page E6: INC - Zero Page