> All6809/src  Assemble all 6809 opcodes : (outfile$="6809" 2 : " at line ";: &FFFF:ș "OS_GetEnv"A$:A$,5)<>"B6809":"B6809"+A$,A$," ")) F: P dp=&12 Z imm=&34 d ext=&5678 n n16=&9ABC xload%=&8000  mcode% &1000 : OPT  1 output listing $ 2 report undefined variables  4 object code at O%  8 limit in L% & 16 6309 opcodes (65816, ARM+1)  32 (ARM+2) 64 (64-bit) 128 :  opt%=4 7 3 P%=load%:O%=mcode%  [OPT opt%  .exec% " ; comment , \ comment 6: @: JNEG ; HBRA rel8 ; 20 RBRN rel8 ; 21 \BHI rel8 ; 22 fBLS rel8 ; 23 pBCC rel8 ; 24 zBCS rel8 ; 25 BNE rel8 ; 26 BEQ rel8 ; 27 BVC rel8 ; 28 BVS rel8 ; 29 BPL rel8 ; 2A BMI rel8 ; 2B BGE rel8 ; 2C BLT rel8 ; 2D BGT rel8 ; 2E BLE rel8 ; 2F  .rel8 ; ; idx 0rrnnnnn LEAX -9,X ; 30 17 LEAY -5,Y ; 31 3B LEAS 5,U ; 32 45 $LEAU 9,S ; 33 69 .; 8#PSHS CC ; 34 01 B#PSHS CC,A ; 34 03 L#PSHS CC,A,B ; 34 07 V#PSHS CC,A,B,DP ; 34 0F `#PSHS CC,A,B,DP,X ; 34 1F j#PSHS CC,A,B,DP,X,Y ; 34 3F t#PSHS CC,A,B,DP,X,Y,S ; 34 7F ~#PSHS CC,A,B,DP,X,Y,S,PC ; 34 FF ; #PULS CC ; 35 01 #PULS CC,A ; 35 03 #PULS CC,A,B ; 35 07 #PULS CC,A,B,DP ; 35 0F #PULS CC,A,B,DP,X ; 35 1F #PULS CC,A,B,DP,X,Y ; 35 3F #PULS CC,A,B,DP,X,Y,S ; 35 7F #PULS CC,A,B,DP,X,Y,S,PC ; 35 FF ; #PSHU CC ; 36 01 #PSHU CC,A ; 36 03 #PSHU CC,A,B ; 36 07  #PSHU CC,A,B,DP ; 36 0F #PSHU CC,A,B,DP,X ; 36 1F #PSHU CC,A,B,DP,X,Y ; 36 3F (#PSHU CC,A,B,DP,X,Y,S ; 36 7F 2#PSHU CC,A,B,DP,X,Y,S,PC ; 36 FF <; F#PULU CC ; 37 01 P#PULU CC,A ; 37 03 Z#PULU CC,A,B ; 37 07 d#PULU CC,A,B,DP ; 37 0F n#PULU CC,A,B,DP,X ; 37 1F x#PULU CC,A,B,DP,X,Y ; 37 3F #PULU CC,A,B,DP,X,Y,S ; 37 7F #PULU CC,A,B,DP,X,Y,S,PC ; 37 FF ; #EQUB &38 ; 38 = CWAI ; 6309 RTS ; 39 ABX ; 3A RTI ; 3B CWAI #imm ; 3C MUL ; 3D #EQUB &3E ; 3E = RESET ; 6309 SWI ; 3F ; NEGA ; 40 EQUB &41 ; 41 EQUB &42 ; 42 COMA ; 43 "LSRA ; 44 ,EQUB &45 ; 45 6RORA ; 46 @ASRA ; 47 JASLA ; 48 TROLA ; 49 ^DECA ; 4A hEQUB &4B ; 4B rINCA ; 4C |TSTA ; 4D EQUB &4E ; 4E CLRA ; 4F ; NEGB ; 50 EQUB &51 ; 51 EQUB &52 ; 52 COMB ; 53 LSRB ; 54 EQUB &55 ; 55 RORB ; 56 ASRB ; 57 ASLB ; 58 ROLB ; 59 DECB ; 5A EQUB &5B ; 5B INCB ; 5C &TSTB ; 5D 0EQUB &5E ; 5E :CLRB ; 5F D; N; idx 1rr00000 ,R+ XNEG ,X+ ; 60 80 b; neg idx ; 61 l; com idx ; 62 vCOM ,Y+ ; 63 A0 LSR ,U+ ; 64 C0 ; lsr idx ; 65 ROR ,S+ ; 66 E0 ; ; idx 1rr00001 ,R++ ASR ,X++ ; 67 81 ASL ,Y++ ; 68 A1 ROL ,U++ ; 69 C1 DEC ,S++ ; 6A E1 ; dec idx ; 6B ; ; idx 1rr00010 ,-R INC ,-X ; 6C 82 TST ,-Y ; 6D A2  JMP ,-U ; 6E C2 CLR ,-S ; 6F E2  ; *NEG >ext ; 70 4EQUB &71 ; 71 >EQUB &72 ; 72 HCOM >ext ; 73 RLSR >ext ; 74 \EQUB &75 ; 75 fROR >ext ; 76 pASR >ext ; 77 zASL >ext ; 78 ROL >ext ; 79 DEC >ext ; 7A EQUB &7B ; 7B INC >ext ; 7C TST >ext ; 7D JMP >ext ; 7E CLR >ext ; 7F ; SUBA #imm ; 80 CMPA #imm ; 81 SBCA #imm ; 82 SUBD #n16 ; 83 A #imm ; 84 BITA #imm ; 85 LDA #imm ; 86 EQUB &87 ; 87 $A #imm ; 88 .ADCA #imm ; 89 8A #imm ; 8A BADDA #imm ; 8B LCMPX #n16 ; 8C VBSR rel8 ; 8D `LDX #n16 ; 8E jEQUB &8F ; 8F t; ~SUBA ext ; B0 "CMPA >ext ; B1 ,SBCA >ext ; B2 6SUBD >ext ; B3 @A >ext ; B4 JBITA >ext ; B5 TLDA >ext ; B6 ^STA >ext ; B7 hA >ext ; B8 rADCA >ext ; B9 |A >ext ; BA ADDA >ext ; BB CMPX >ext ; BC JSR >ext ; BD LDX >ext ; BE STX >ext ; BF ; SUBB #imm ; C0 CMPB #imm ; C1 SBCB #imm ; C2 ADDD #n16 ; C3 B #imm ; C4 BITB #imm ; C5 LDB #imm ; C6 EQUB &C7 ; C7 B #imm ; C8 ADCB #imm ; C9 &B #imm ; CA 0ADDB #imm ; CB :LDD #n16 ; CC D&EQUB &CD ; CD = LDQ #n32 ; 6309 NLDU #n16 ; CE XEQUB &CF ; CF b; lSUBB 7) *SUBB -64,X ; E0 88 C0 4CMPB -32,Y ; E1 A8 E0 >SBCB 32,U ; E2 C8 20 HADDD 64,S ; E3 E8 40 R; \ ; idx 1rr01001 hh ll - n16,R fB -6400,X ; E4 89 pBITB -3200,Y ; E5 A9 zLDB 3200,U ; E6 C9 0C 80 STB 6400,Y ; E7 E9 19 00 ; !; idx 1rr01010 - not used ; idx 1rr01011 D,R B D,X ; E8 8B ADCB D,Y ; E9 AB B D,U ; EA CB ADDB D,S ; EB EB ; ; idx 1rr01100 n,PCR .near1 LDD near2,PCR ; EC 8C 09 STD near2,PCR ; ED AC 06 LDU near1,PCR ; EE CC F7 STU near1,PCR ; EF EC F4  .near2 $; .; idx 1rr01101 n16,PCR 8!LDD &2000,PCR ; EC 8D hi lo B!STD &4000,PCR ; ED AD hi lo L!LDU &C000,PCR ; EE CD hi lo V!STU &E000,PCR ; EF ED hi lo `; jSUBB >ext ; F0 tCMPB >ext ; F1 ~SBCB >ext ; F2 ADDD >ext ; F3 B >ext ; F4 BITB >ext ; F5 LDB >ext ; F6 STB >ext ; F7 B >ext ; F8 ADCB >ext ; F9 B >ext ; FA ADDB >ext ; FB LDD >ext ; FC STD >ext ; FD LDU >ext ; FE STU >ext ; FF  ; '; Indirect indexed addressing modes ; 1rr10001 [,R++] (LDA [,X++] ; A6 91 2LDA [,Y++] ; A6 B1 <LDA [,U++] ; A6 D1 FLDA [,S++] ; A6 F1 P; Z; 1rr10011 [,--R] dLDA [,--X] ; A6 93 nLDA [,--Y] ; A6 B3 xLDA [,--U] ; A6 D3 LDA [,--S] ; A6 F3 ; ; 1rr10100 [,R] LDA [,X] ; A6 94 LDA [,Y] ; A6 B4 LDA [,U] ; A6 D4 LDA [,S] ; A6 F4 ; ; 1rr10101 [B,R] LDA [B,X] ; A6 95 LDA [B,Y] ; A6 B5 LDA [B,U] ; A6 D5 LDA [B,S] ; A6 F5 ; ; 1rr10110 [A,R] LDA [A,X] ; A6 96 "LDA [A,Y] ; A6 B6 ,LDA [A,U] ; A6 D6 6LDA [A,S] ; A6 F6 @; J; 1rr11000 nn [n,R] TLDA [-64,X] ; A6 98 C0 ^LDA [-32,Y] ; A6 B8 E0 hLDA [32,U] ; A6 D8 20 rLDA [64,S] ; A6 F8 40 |; ; 1rr11001 hh ll [n16,R] !LDA [-6400,X] ; A6 99 xx xx !LDA [-3200,Y] ; A6 B9 xx xx !LDA [3200,U] ; A6 D9 0C 80 !LDA [6400,S] ; A6 F9 19 00 ; ; 1rr11011 [D,R] LDA [D,X] ; A6 9B LDA [D,Y] ; A6 BB LDA [D,U] ; A6 DB LDA [D,S] ; A6 FB ; ; 10011100 nn [n,PCR]  .near3 LDA [near4,PCR] ; A6 9C 09 LDA [near4,PCR] ; A6 BC 06 &LDA [near3,PCR] ; A6 DC F7 0LDA [near3,PCR] ; A6 FC F4 : .near4 D; N; 10011101 hh ll [n16,PCR] X!LDA [&2000,PCR] ; A6 9D hi lo b!LDA [&4000,PCR] ; A6 BD hi lo l!LDA [&C000,PCR] ; A6 DD hi lo v!LDA [&E000,PCR] ; A6 FD hi lo ; ; 10011111 hh ll [n16] !LDA [&4000] ; A6 9F 40 00 !LDA [&8000] ; A6 BF 80 00 !LDA [&C000] ; A6 DF C0 00 !LDA [&E000] ; A6 FF E0 00 ; ; ; 10 PREFIX ; --------- 0EQUW &2010 ; 10 20 - LBRA rel16 -> 16 xx xx LBRN rel16 ; 10 21 LBHI rel16 ; 10 22 LBLS rel16 ; 10 23  LBCC rel16 ; 10 24 LBCS rel16 ; 10 25  LBNE rel16 ; 10 26 *LBEQ rel16 ; 10 27 4LBVC rel16 ; 10 28 >LBVS rel16 ; 10 29 HLBPL rel16 ; 10 2A RLBMI rel16 ; 10 2B \LBGE rel16 ; 10 2C fLBLT rel16 ; 10 2D pLBGT rel16 ; 10 2E zLBLE rel16 ; 10 2F ; SWI2 ; 10 3F ; CMPD #n16 ; 10 83 CMPY #n16 ; 10 8C LDY #n16 ; 10 8E CMPD ext ; 10 B3 CMPY >ext ; 10 BC $LDY >ext ; 10 BE .LDS >ext ; 10 BF 8LDS #n16 ; 10 CE BLDS ext ; 10 FE tSTS >ext ; 10 FF ~; ; 11 PREFIX ; --------- SWI3 ; 11 3F CMPU #n16 ; 11 83 CMPS #n16 ; 11 8C CMPU ext ; 11 B3 CMPS >ext ; 11 BC ; DCB &12 ; 12  DCW &1234 ; 12 34  DCD &12345678 ; 12 34 56 78 ; (EQUB &12 ; 12 2EQUW &1234 ; 34 12 < EQUD &12345678 ; 78 56 34 12 FEQUS "HELLO WORLD" P*SWI:EQUB 254:EQUS "Bad command":EQUB 0 Z1SWI:DCB 254:EQUS "Bad command":DCB 0 ; DCS? d; n; x; '; #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 9; idx - indexed addressing mode, see next table ,; r0,r1 - next byte contains D; Opcodes in lower case in the above list are 'undocumented'. ; #; Indexed (idx) addressing mode #; ----------------------------- P; Specified by a post-byte, after the opcode and before any additional data. ; "H; postbyte data assembler postbyte data assembler ,*; 0rrnnnnn n,R | 64; 1rr00000 ,R+ | 1??10000 @E; 1rr00001 ,R++ | 1rr10001 [,R++] J4; 1rr00010 ,-R | 1??10010 TE; 1rr00011 ,--R | 1rr10011 [,--R] ^C; 1rr00100 ,R | 1rr10100 [,R] hD; 1rr00101 B,R | 1rr10101 [B,R] rD; 1rr00110 A,R | 1rr10110 [A,R] |4; 1??00111 | 1??10111 D; 1rr01000 nn n,R | 1rr11000 nn [n,R] F; 1rr01001 hh ll n16,R | 1rr11001 hh ll [n16,R] 4; 1??01010 | 1??11010 D; 1rr01011 D,R | 1rr11011 [D,R] F; 1xx01100 nn n,PCR | 1xx11100 nn [n,PCR] H; 1xx01101 hh ll n16,PCR | 1xx11101 hh ll [n16,PCR] 4; 1??01110 | 1??11110 D; 1??01111 | 10011111 hh ll [n16] 4; | 10111111 4; | 11011111 4; | 11111111 $; rr=00,01,10,11 for R=X,Y,U,S ; ; Other notes ; ----------- L; The only difference between the 6809 and the 6809e is the pinouts. The &"; instruction set is the same: 0>; 6809 Halt, XTAL, >EXTAL, Reset, MRDY, Q, E, DMA/BREQ :9; 6809e Halt, TSC, LIC, Reset, AVMA, Q, E, Busy D; NM; The 6309 is a further develpment by Hitatchi with more instructions and X; registers. b; lL; The 68xx series are bigendian, that is, multibyte values are stored in v2; memory with the most significant byte first.     .end% \ End of all code ]  NA$="SAVE "+outfile$+" "+~mcode%+"+"+~(O%-mcode%)+" "+~exec%+" "+~load%  A$;: A$: