6809 Opcode Map =============== http://mdfs.net/Docs/Comp/6809/OpCodeMap Author: J.G.Harston - Update: 0.10 - Date: 02-Mar-2007 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F +----------+----------+----------+----------+----------+----------+----------+----------+ 00 |NEG ext |neg >ext |com >ext |COM >ext |LSR >ext |lsr >ext |ROR >ext |ASR >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ 78 |ASL >ext |ROL >ext |DEC >ext |dec >ext |INC >ext |TST >ext |JMP >ext |CLR >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ 80 |SUBA #imm |CMPA #imm |SBCA #imm |SUBD #imm |ANDA #imm |BITA #imm |LDAA #imm | | +----------+----------+----------+----------+----------+----------+----------+----------+ 88 |EORA #imm |ADCA #imm |ORAA #imm |ADDA #imm |CMPX #imm |BSR rel |LDX #n16 | | +----------+----------+----------+----------+----------+----------+----------+----------+ 90 |SUBA ext |CMPA >ext |SBCA >ext |SUBD >ext |ANDA >ext |BITA >ext |LDAA >ext |STAA >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ B8 |EORA >ext |ADCA >ext |ORAA >ext |ADDA >ext |CMPX >ext |JSR >ext |LDX >ext |STX >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ C0 |SUBB #imm |CMPB #imm |SBCB #imm |ADDD #imm |ANDB #imm |BITB #imm |LDAB #imm | | +----------+----------+----------+----------+----------+----------+----------+----------+ C8 |EORB #imm |ADCB #imm |ORAB #imm |ADDB #imm |LDD #n16 | |LDU #n16 | | +----------+----------+----------+----------+----------+----------+----------+----------+ D0 |SUBB ext |CMPB >ext |SBCB >ext |ADDD >ext |ANDB >ext |BITB >ext |LDAB >ext |STAB >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ F8 |EORB >ext |ADCB >ext |ORAB >ext |ADDB >ext |LDD >ext |STD >ext |LDU >ext |STU >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ *** PAGE 10 *** 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F +----------+----------+----------+----------+----------+----------+----------+----------+ 20 |LBRA rel16|LBRN rel16|LBHI rel16|LBLS rel16|LBCC rel16|LBCS rel16|LBNE rel16|LBEQ rel16| +----------+----------+----------+----------+----------+----------+----------+----------+ 28 |LBVC rel16|LBVS rel16|LBPL rel16|LBMI rel16|LBGE rel16|LBLT rel16|LBGT rel16|LBLE rel16| +----------+----------+----------+----------+----------+----------+----------+----------+ 30 | | | | | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ 38 | | | | | | | |SWI2 | +----------+----------+----------+----------+----------+----------+----------+----------+ +----------+----------+----------+----------+----------+----------+----------+----------+ 80 | | | |CMPD #n16 | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ 88 | | | | |CMPY #n16 | |LDY #n16 | | +----------+----------+----------+----------+----------+----------+----------+----------+ 90 | | | |CMPD ext | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ B8 | | | | |CMPY >ext | |LDY >ext |STY >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ C0 | | | | | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ C8 | | | | | | |LDS #n16 | | +----------+----------+----------+----------+----------+----------+----------+----------+ D0 | | | | | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ D8 | | | | | | |LDS ext |STS >ext | +----------+----------+----------+----------+----------+----------+----------+----------+ *** PAGE 11 *** 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F +----------+----------+----------+----------+----------+----------+----------+----------+ 38 | | | | | | | |SWI3 | +----------+----------+----------+----------+----------+----------+----------+----------+ +----------+----------+----------+----------+----------+----------+----------+----------+ 80 | | | |CMPU #n16 | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ 88 | | | | |CMPS #n16 | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ 90 | | | |CMPU ext | | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ B8 | | | | |CMPS >ext | | | | +----------+----------+----------+----------+----------+----------+----------+----------+ Notes ----- #imm - 8bit immediate number #n16 - 16bit immediate number #n32 - 32bit immediate number ext - 16bit absolute address rel - 8bit relative offset rel16 - 16bit relative offset regs - register map idx - indexed addressing mode, see next table r0,r1 - next byte contains Opcodes in lower case in the above list are 'undocumented'. register map: b7 b6 b5 b4 b3 b2 b1 b0 pushed last/ PC S/U Y X DP B A CC pushed first/ popped first popped last r0,r1: 0 D 4 S 8 A 12 - 1 X 5 PC 9 B 13 - 2 Y 6 - 10 CC 14 - 3 U 7 - 11 DP 15 - Indexed (idx) addressing mode ----------------------------- Specified by a post-byte, after the opcode and before any additional data. postbyte data assembler postbyte data assembler 0rrnnnnn n,R | 1rr00000 ,R+ | 1??10000 1rr00001 ,R++ | 1rr10001 [,R++] 1rr00010 ,-R | 1??10010 1rr00011 ,--R | 1rr10011 [,--R] 1rr00100 ,R | 1rr10100 [,R] 1rr00101 B,R | 1rr10101 [B,R] 1rr00110 A,R | 1rr10110 [A,R] 1??00111 | 1??10111 1rr01000 nn n,R | 1rr11000 nn [n,R] 1rr01001 hh ll n16,R | 1rr11001 hh ll [n16,R] 1??01010 | 1??11010 1rr01011 D,R | 1rr11011 [D,R] 1xx01100 nn n,PCR | 1xx11100 nn [n,PCR] 1xx01101 hh ll n16,PCR | 1xx11101 hh ll [n16,PCR] 1??01110 | 1??11110 1??01111 | 10011111 hh ll [n16] | 10111111 | 11011111 | 11111111 rr=00,01,10,11 for R=X,Y,U,S Other notes ----------- The only difference between the 6809 and the 6809e is the pinouts. The instruction set is the same: 6809: Halt, XTAL, >EXTAL, Reset, MRDY, Q, E, DMA/BREQ 6809e: Halt, TSC, LIC, Reset, AVMA, Q, E, Busy The 6309 is a further develpment by Hitatchi with more instructions and registers. The 68xx series are bigendian, that is, multibyte values are stored in memory with the most significant byte first.