-65SC02 mode supports all regular 6502 instructions, plus the following:
-
-
-$04 tsb zp
-$0c tsb abs16
-$12 ora (zp)
-$14 trb zp
-$1a inc
-$1c trb abs16
-$32 and (zp)
-$34 bit zp, x
-$3a dec
-$3c bit abs16, x
-$52 eor (zp)
-$5a phy
-$64 stz zp
-$72 adc (zp)
-$74 stz zp, x
-$7a ply
-$7c jmp (abs16, x)
-$80 bra rel8
-$89 bit #imm8
-$92 sta (zp)
-$9c stz abs16
-$9e stz abs16, x
-$b2 lda (zp)
-$d2 cmp (zp)
-$da phx
-$f2 sbc (zp)
-$fa plx
-
+65SC02 mode supports all regular 6502 instructions, plus the original CMOS
+instructions.
-65C02 mode
+65C02 mode (CMOS with Rockwell extensions)
-65C02 mode supports all "official" W65C02 opcodes.
+65C02 mode supports all original CMOS instructions, plus the Rockwell (bit
+manipulation instructions) extensions.
-The R65C02 adds bit manipulation instructions:
-
-smbB zp set bit in zp location
-rmbB zp reset bit in zp location
-bbsB zp, rel8 branch if bit is set in zp location
-bbrB zp, rel8 branch if bit is reset in zp location
-
+W65C02 mode (CMOS with WDC extensions)
-And the W65C02 adds those:
+W65C02 mode supports the Rockwell extensions, plus wai and stp.
-
-$cb wai wait for interrupt
-$db stp wait for reset
-
+
+65CE02 mode
4510 mode
@@ -595,14 +561,6 @@ The 4510 is a microcontroller that is the core of the Commodore C65 aka C64DX.
It contains among other functions a slightly modified 65CE02/4502 CPU, to allow
address mapping for 20 bits of address space (1 megabyte addressable area).
-The 4510 mode supports the complete (legal) 65CE02 instruction set, plus these
-three, which were changed/added:
-
-$5c map "4-byte NOP reserved for future expansion" on 65CE02
-$cb asw $1234 wai on W65C02
-$db phz stp on W65C02
-
-
As compared to the description of the CPU in the
@@ -626,40 +584,9 @@ The 45GS02 is a microcontroller that is the core of the MEGA65.
It is an extension of the 4510 CPU and adds 32-bit addressing and a 32-bit
pseudo register Q that is comprised of the four registers A, X, Y, and Z.
-HUC6280 mode
+HUC6280 mode (CMOS with Hudson extensions)
-The HUC6280 is a superset of the R65C02. It adds some other instructions:
-
-
-$02 sxy
-$03 st0 #{imm}
-$13 st1 #{imm}
-$22 sax
-$23 st2 #{imm}
-$42 say
-$43 tma #{imm}
-$44 bsr {rel}
-$53 tam #{imm}
-$54 csl
-$62 cla
-$73 tii {addr}, {addr}, {addr}
-$82 clx
-$83 tst #{imm}, {zp}
-$82 clx
-$83 tst #{imm}, {zp}
-$93 tst #{imm}, {addr}
-$a3 tst #{imm}, {zp}, x
-$b3 tst #{imm}, {addr}, x
-$c2 cly
-$c3 tdd {addr}, {addr}, {addr}
-$d3 tin {addr}, {addr}, {addr}
-$d4 csh
-$e3 tia {addr}, {addr}, {addr}
-$f3 tai {addr}, {addr}, {addr}
-$f4 set
-
-
-Note that this CPU does not implement wai and stp .
+The HUC6280 is a superset of 65C02, used in the PC Engine.
M740 mode
diff --git a/doc/cpus.sgml b/doc/cpus.sgml
new file mode 100644
index 000000000..ec6c550ee
--- /dev/null
+++ b/doc/cpus.sgml
@@ -0,0 +1,342 @@
+
+
+
+ca65/da65 Users Guide
+,
+
+
+
+An Overview on all supported CPUs
+
+
+
+
+
+
+
+Overview
+
+
+Supported CPUs
+
+
+ [ - NMOS 6502 (all legal instructions)
+ ][ - NMOS 6502 with all undocumented instructions
+ ][ - the emulated CPU of the C64DTV device
+ ][ - first CMOS instruction set (no bit manipulation)
+ ][ - full CMOS instruction set (has bit manipulation)
+ ][ - CMOS with WDC extensions
+ ][ - CMOS with GTE extensions
+ ][ - the CPU of the SNES, and the SCPU
+ ][ - the CPU of the PC engine
+ ][ - the CPU of the Commodore C65
+ ][ - the CPU of the Commodore MEGA65
+ ][ - a Microcontroller by Mitsubishi
+ ][ - an interpreter for a pseudo 16 bit CPU
+ ]
+
+
+6502 mode
+
+The default (no CPU given on the command line or in the 6502X mode
+
+6502X mode is an extension to the normal 6502 mode. In this mode, several
+mnemonics for undocumented instructions of the NMOS 6502 CPUs are accepted.
+
+Note: Since these instructions are undocumented, there are no official mnemonics
+for them.
+
+
+ALR: A:=(A and #{imm})/2;
+ANC: A:= A and #{imm}; Generates opcode $0B.
+ANE: A:= (A or CONST) and X and #{imm};
+ARR: A:=(A and #{imm})/2;
+AXS: X:=A and X-#{imm};
+DCP: {addr}:={addr}-1; A-{addr};
+ISC: {addr}:={addr}+1; A:=A-{addr};
+JAM:
+LAS: A,X,S:={addr} and S;
+LAX: A,X:={addr};
+NOP: #{imm}; zp; zp,x; abs; abs,x
+RLA: {addr}:={addr}rol; A:=A and {addr};
+RRA: {addr}:={addr}ror; A:=A adc {addr};
+SAX: {addr}:=A and X;
+SHA: {addr}:=A and X and {addr hi +1};
+SHX: {addr}:=X and {addr hi +1};
+SHY: {addr}:=Y and {addr hi +1};
+SLO: {addr}:={addr}*2; A:=A or {addr};
+SRE: {addr}:={addr}/2; A:=A xor {addr};
+TAS: {addr}:=A and X and {addr hi +1}; SP:=A and X;
+
+
+
+DTV mode
+
+The C64DTV CPU is based on the 6510, but adds some instructions, and does not
+support all undocumented instructions.
+
+
+bra {rel} Generates opcode $12.
+sac #{imm} Generates opcode $32.
+sir #{imm} Generates opcode $42.
+
+
+Supported undocumented instructions:
+
+
+ALR: A:=(A and #{imm})/2;
+ANC: A:=A and #{imm}; Generates opcode $0B.
+ARR: A:=(A and #{imm})/2;
+AXS: X:=A and X-#{imm};
+LAS: A,X,S:={addr} and S;
+LAX: A,X:={addr};
+NOP: #{imm}; zp; zp,x; abs; abs,x
+RLA: {addr}:={addr}rol; A:=A and {addr};
+RRA: {addr}:={addr}ror; A:=A adc {addr};
+SHX: {addr}:=X and {addr hi +1};
+SHY: {addr}:=y and {addr hi +1};
+
+
+
+65SC02 (Original CMOS)
+
+The first CMOS instruction set, without bit manipulation or wai/stp.
+
+
+$04 tsb zp
+$0c tsb abs16
+$12 ora (zp)
+$14 trb zp
+$1a inc
+$1c trb abs16
+$32 and (zp)
+$34 bit zp, x
+$3a dec
+$3c bit abs16, x
+$52 eor (zp)
+$5a phy
+$64 stz zp
+$72 adc (zp)
+$74 stz zp, x
+$7a ply
+$7c jmp (abs16, x)
+$80 bra rel8
+$89 bit #imm8
+$92 sta (zp)
+$9c stz abs16
+$9e stz abs16, x
+$b2 lda (zp)
+$d2 cmp (zp)
+$da phx
+$f2 sbc (zp)
+$fa plx
+
+
+
+65C02 (CMOS with Rockwell extensions)
+
+The 65C02 understands the same opcodes as the 65SC02, plus 16 additional bit
+manipulation and bit test-and-branch commands.
+
+The R65C02 adds bit manipulation instructions:
+
+
+smbB zp set bit in zp location
+rmbB zp reset bit in zp location
+bbsB zp, rel8 branch if bit is set in zp location
+bbrB zp, rel8 branch if bit is reset in zp location
+
+
+
+W65C02 (CMOS with WDC extensions)
+
+This mode also supports wai/stp.
+
+
+$cb wai wait for interrupt
+$db stp wait for reset
+
+
+
+65CE02 (CMOS with GTE extensions)
+
+
+$02 cle clear stack extend disable
+$03 see set stack extend disable
+$0b tsy transfer stack_ptr_high to Y
+$12 ora (zp), z
+$13 lbpl rel16
+$1b inz increment Z
+$22 jsr (abs16)
+$23 jsr (abs16, x)
+$2b tys transfer Y to stack_ptr_high
+$32 and (zp), z
+$33 lbmi rel16
+$3b dez decrement Z
+$42 neg negate A
+$43 asr
+$44 asr zp
+$4b taz transfer A to Z
+$52 eor (zp), z
+$53 lbvc rel16
+$54 asr zp, x
+$5b tab
+$5c aug "4-byte NOP reserved for future expansion"
+$62 rtn #imm8
+$63 lbsr rel16 relative jsr, "branch to subroutine"
+$64 stz zp store Z
+$6b tza transfer Z to A
+$72 adc (zp), z
+$73 lbvs rel16
+$74 stz zp, x store Z
+$7b tba
+$82 sta (off8, s), y
+$83 lbra rel16 relative jmp
+$8b sty abs16, x
+$92 sta (zp), z
+$93 lbcc rel16
+$9b stx abs16, y
+$9c stz abs16 store Z
+$9e stz abs16, x store Z
+$a3 ldz #imm8
+$ab ldz abs16
+$b2 lda (zp), z
+$b3 lbcs rel16
+$bb ldz abs16, x
+$c2 cpz #imm8
+$c3 dew zp
+$cb asw abs16
+$d2 cmp (zp), z
+$d3 lbne rel16
+$d4 cpz zp
+$db phz push Z
+$dc cpz abs16
+$e2 lda (off8, s), y
+$e3 inw zp
+$eb row abs16
+$f2 sbc (zp), z
+$f3 lbeq rel16
+$f4 phw #imm16
+$fb plz pull Z
+$fc phw abs16
+
+
+
+4510 mode
+
+The 4510 is a microcontroller that is the core of the Commodore C65 aka C64DX.
+It contains among other functions a slightly modified 65CE02/4502 CPU, to allow
+address mapping for 20 bits of address space (1 megabyte addressable area).
+
+The 4510 mode supports the complete (legal) 65CE02 instruction set, but changes
+the 4-Byte NOP into the "map" instruction:
+
+
+$5c map "4-byte NOP reserved for future expansion" on 65CE02
+
+
+For more information about the Commodore C65/C64DX and the 4510 CPU, see
+ and
+.
+
+
+45GS02 mode
+
+The 45GS02 is a microcontroller that is the core of the MEGA65.
+It is an extension of the 4510 CPU and adds 32-bit addressing and a 32-bit
+pseudo register Q that is comprised of the four registers A, X, Y, and Z.
+
+
+HUC6280 mode
+
+The HUC6280 is a superset of 65C02. It adds some other instructions:
+
+
+$02 sxy
+$03 st0 #{imm}
+$13 st1 #{imm}
+$22 sax
+$23 st2 #{imm}
+$42 say
+$43 tma #{imm}
+$44 bsr {rel}
+$53 tam #{imm}
+$54 csl
+$62 cla
+$73 tii {addr}, {addr}, {addr}
+$82 clx
+$83 tst #{imm}, {zp}
+$82 clx
+$83 tst #{imm}, {zp}
+$93 tst #{imm}, {addr}
+$a3 tst #{imm}, {zp}, x
+$b3 tst #{imm}, {addr}, x
+$c2 cly
+$c3 tdd {addr}, {addr}, {addr}
+$d3 tin {addr}, {addr}, {addr}
+$d4 csh
+$e3 tia {addr}, {addr}, {addr}
+$f3 tai {addr}, {addr}, {addr}
+$f4 set
+
+
+
+M740 mode
+
+The M740 is a microcontroller by Mitsubishi, which was marketed for embedded
+devices in the mid 80s. It is a superset of 6502, and a subset of 65SC02, plus
+some new instructions.
+
+For more information about the M740 Controllers, see
+.
+
+
+
+65816 mode
+
+The 65816 support requires annotating ranges with the M and X flag states.
+This can be recorded with an emulator that supports Code and Data Logging,
+for example. Disassemble one bank at a time.
+
+
+Sweet16
+
+SWEET 16 is an interpreter for a pseudo 16 bit CPU written by Steve Wozniak
+for the Apple ][ machines. It is available in the Apple ][ ROM.
+
+For more information about SWEET 16, see
+.
+
+
+Copyright
+
+ca65 (and all cc65 binutils) are (C) Copyright 1998-2003 Ullrich von
+Bassewitz. For usage of the binaries and/or sources the following
+conditions do apply:
+
+This software is provided 'as-is', without any expressed or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+
+- The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
- Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+
- This notice may not be removed or altered from any source
+ distribution.
+
+
+
+
+
diff --git a/doc/da65.sgml b/doc/da65.sgml
index 314e552a9..e2c6d7e90 100644
--- a/doc/da65.sgml
+++ b/doc/da65.sgml
@@ -270,8 +270,10 @@ disassembler may be told which CPU to support:
[ - NMOS 6502 (all legal instructions)
][ - NMOS 6502 with all undocumented instructions
][ - the emulated CPU of the C64DTV device
- ][ - first CMOS instruction set (no bit manipulation, no wai/stp)
- ][ - full CMOS instruction set (has bit manipulation and wai/stp)
+ ][ - first CMOS instruction set (no bit manipulation)
+ ][ - full CMOS instruction set (has bit manipulation)
+ ][ - CMOS with WDC extensions
+ ][ - CMOS with GTE extensions
][ - the CPU of the SNES, and the SCPU
][ - the CPU of the PC engine
][ - the CPU of the Commodore C65
@@ -279,7 +281,7 @@ disassembler may be told which CPU to support:
][ - a Microcontroller by Mitsubishi
-for more details on the various CPUs, see ] .
+for more details on the various CPUs, see .
6502 mode
@@ -308,8 +310,12 @@ The first CMOS instruction set, without bit manipulation or wai/stp.
The 65C02 understands the same opcodes as the 65SC02, plus 16 additional bit
manipulation and bit test-and-branch commands.
+W65C02 mode
+
This mode also supports wai/stp.
+65CE02 mode
+
4510 mode