Defender Sound Board Code

This is a disassembly of one of two ROM images that I have found for the Defender sound board. The other ROM image is largely the same, but with some significant omissions, and rerouting of jumps and subroutines. At this time I do not have any plans to disassemble that ROM.

                        FCB $FF                 ;F800: FF;

RESET			SEI			;F801: 0F        ;VECTOR at $FFFE and $FFFA, disable interrupts
			LDS #$007F		;F802: 8E 00 7F  ;initialize stack pointer to top of RAM
			LDX #$0400		;F805: CE 04 00  ;load PIA address
			CLR $01,X		;F808: 6F 01     ;switch to DDR
			CLR $03,X		;F80A: 6F 03     ;ditto for second port
			LDAA #$FF		;F80C: 86 FF;
			STAA $00,X		;F80E: A7 00     ;all outputs on channel A
			CLR $02,X		;F810: 6F 02     ;all inputs on channel B
			LDAA #$37		;F812: 86 37     ;CB2 is output,output reg selected,
			STAA $03,X		;F814: A7 03     ;IRQB on low-to-high and enabled
			LDAA #$3C		;F816: 86 3C     ;CA2 is output,output reg selected,
			STAA $01,X		;F818: A7 01     ;IRQA on high-to-low and disabled
			STAA <$09		;F81A: 97 09     ;store that setting
			CLRA			;F81C: 4F;
			STAA <$07		;F81D: 97 07     ;clear several mem locations
			STAA <$04		;F81F: 97 04;
			STAA <$05		;F821: 97 05;
			STAA <$06		;F823: 97 06;
			STAA <$08		;F825: 97 08;
			CLI			;F827: 0E        ;enable interrupts
$F828			BRA $F828		;F828: 20 FE     ;just waiting for an interrupt
Multiply the number in the A register by 9, use that to index into a table starting at $FD76, and put a 9 in the B reg.
$F82A			TAB			;F82A: 16; SUBRTN
			ASLA			;F82B: 48;
			ASLA			;F82C: 48;
			ASLA			;F82D: 48        ;A x 8
			ABA			;F82E: 1B        ;A x 8 + A = 9A
			LDX #$0013		;F82F: CE 00 13  ;load 19 in X reg
			STX <$0F		;F832: DF 0F     ;store in zero page
			LDX #$FD76		;F834: CE FD 76  ;load table address
			JSR CalcOfst		;F837: BD FD 21  ;calculate X + A -> X
			LDAB #$09		;F83A: C6 09     ;put a 9 in B reg
			JMP $FB0A		;F83C: 7E FB 0A  ;

$F83F			LDAA <$1B		;F83F: 96 1B     ;SUBRTN
			STAA >$0400		;F841: B7 04 00;
$F844			LDAA <$13		;F844: 96 13;
			STAA <$1C		;F846: 97 1C;
			LDAA <$14		;F848: 96 14;
			STAA <$1D		;F84A: 97 1D;
$F84C			LDX <$18		;F84C: DE 18;
$F84E			LDAA <$1C		;F84E: 96 1C;
			COM >$0400		;F850: 73 04 00;
$F853			DEX			;F853: 09;
			BEQ $F866		;F854: 27 10;
			DECA			;F856: 4A;
			BNE $F853		;F857: 26 FA;
			COM >$0400		;F859: 73 04 00;
			LDAA <$1D		;F85C: 96 1D;
$F85E			DEX			;F85E: 09;
			BEQ $F866		;F85F: 27 05;
			DECA			;F861: 4A;
			BNE $F85E		;F862: 26 FA;
			BRA $F84E		;F864: 20 E8;
$F866			LDAA >$0400		;F866: B6 04 00;
			BMI $F86C		;F869: 2B 01;
			COMA			;F86B: 43;
$F86C			ADDA #$00		;F86C: 8B 00;
			STAA >$0400		;F86E: B7 04 00;
			LDAA <$1C		;F871: 96 1C;
			ADDA <$15		;F873: 9B 15;
			STAA <$1C		;F875: 97 1C;
			LDAA <$1D		;F877: 96 1D;
			ADDA <$16		;F879: 9B 16;
			STAA <$1D		;F87B: 97 1D;
			CMPA <$17		;F87D: 91 17;
			BNE $F84C		;F87F: 26 CB;
			LDAA <$1A		;F881: 96 1A;
			BEQ $F88B		;F883: 27 06;
			ADDA <$13		;F885: 9B 13;
			STAA <$13		;F887: 97 13;
			BNE $F844		;F889: 26 B9;
$F88B			RTS			;F88B: 39;

$F88C			LDAA #$01		;F88C: 86 01     ;W vector
			STAA <$1A		;F88E: 97 1A;
			LDAB #$03		;F890: C6 03;
			BRA $F89E		;F892: 20 0A;
$F894			LDAA #$FE		;F894: 86 FE     ;W vector
			STAA <$1A		;F896: 97 1A;
			LDAA #$C0		;F898: 86 C0;
			LDAB #$10		;F89A: C6 10;
			BRA $F89E		;F89C: 20 00     ;really?
$F89E			STAA <$19		;F89E: 97 19;
			LDAA #$FF		;F8A0: 86 FF;
			STAA >$0400		;F8A2: B7 04 00;
			STAB <$15		;F8A5: D7 15;
$F8A7			LDAB <$15		;F8A7: D6 15;
$F8A9			LDAA <$0A		;F8A9: 96 0A;
			LSRA			;F8AB: 44;
			LSRA			;F8AC: 44;
			LSRA			;F8AD: 44;
			EORA <$0A		;F8AE: 98 0A;
			LSRA			;F8B0: 44;
			ROR >$0009		;F8B1: 76 00 09;
			ROR >$000A		;F8B4: 76 00 0A;
			BCC $F8BC		;F8B7: 24 03;
			COM >$0400		;F8B9: 73 04 00;
$F8BC			LDAA <$19		;F8BC: 96 19;
$F8BE			DECA			;F8BE: 4A;
			BNE $F8BE		;F8BF: 26 FD;
			DECB			;F8C1: 5A;
			BNE $F8A9		;F8C2: 26 E5;
			LDAA <$19		;F8C4: 96 19;
			ADDA <$1A		;F8C6: 9B 1A;
			STAA <$19		;F8C8: 97 19;
			BNE $F8A7		;F8CA: 26 DB;
			RTS			;F8CC: 39;

$F8CD			LDAA #$20		;F8CD: 86 20     ;W vector
			STAA <$15		;F8CF: 97 15;
			STAA <$18		;F8D1: 97 18;
			LDAA #$01		;F8D3: 86 01;
			LDX #$0001		;F8D5: CE 00 01;
			LDAB #$FF		;F8D8: C6 FF;
			BRA $F8DC		;F8DA: 20 00     ;doing it again, must be a timing thing
$F8DC			STAA <$13		;F8DC: 97 13;
$F8DE			STX <$16		;F8DE: DF 16;
$F8E0			STAB <$14		;F8E0: D7 14;
			LDAB <$15		;F8E2: D6 15;
$F8E4			LDAA <$0A		;F8E4: 96 0A;
			LSRA			;F8E6: 44;
			LSRA			;F8E7: 44;
			LSRA			;F8E8: 44;
			EORA <$0A		;F8E9: 98 0A;
			LSRA			;F8EB: 44;
			ROR >$0009		;F8EC: 76 00 09;
			ROR >$000A		;F8EF: 76 00 0A;
 			LDAA #$00		;F8F2: 86 00;
			BCC $F8F8		;F8F4: 24 02;
			LDAA <$14		;F8F6: 96 14;
$F8F8			STAA >$0400		;F8F8: B7 04 00;
			LDX <$16		;F8FB: DE 16;
$F8FD			DEX			;F8FD: 09;
			BNE $F8FD		;F8FE: 26 FD;
			DECB			;F900: 5A;
			BNE $F8E4		;F901: 26 E1;
			LDAB <$14		;F903: D6 14;
			SUBB <$13		;F905: D0 13;
			BEQ $F912		;F907: 27 09;
			LDX <$16		;F909: DE 16;
			INX			;F90B: 08;
			LDAA <$18		;F90C: 96 18;
			BEQ $F8E0		;F90E: 27 D0;
			BRA $F8DE		;F910: 20 CC;
$F912			RTS			;F912: 39;

$F913			LDAB #$01		;F913: C6 01     ;W vector
			STAB <$04		;F915: D7 04;
			CLRA			;F917: 4F;
			STAA <$19		;F918: 97 19;
			BRA $F930		;F91A: 20 14;
$F91C			CLRA			;F91C: 4F        ;W vector
			STAA <$19		;F91D: 97 19;
			LDAB #$03		;F91F: C6 03;
			BRA $F930		;F921: 20 0D;
$F923			LDAA #$01		;F923: 86 01     ;W vector
			STAA <$19		;F925: 97 19;
			LDX #$03E8		;F927: CE 03 E8;
			LDAA #$01		;F92A: 86 01;
			LDAB #$FF		;F92C: C6 FF;
			BRA $F930		;F92E: 20 00;
$F930			STAA <$18		;F930: 97 18;
			STAB <$13		;F932: D7 13;
			STX <$16		;F934: DF 16;
			CLR >$0015		;F936: 7F 00 15;
$F939			LDX <$16		;F939: DE 16;
			LDAA >$0400		;F93B: B6 04 00;
$F93E			TAB			;F93E: 16;
			LSRB			;F93F: 54;
			LSRB			;F940: 54;
			LSRB			;F941: 54;
			EORB <$0A		;F942: D8 0A;
			LSRB			;F944: 54;
			ROR >$0009		;F945: 76 00 09;
			ROR >$000A		;F948: 76 00 0A;
			LDAB <$13		;F94B: D6 13;
			TST >$0019		;F94D: 7D 00 19;
			BEQ $F954		;F950: 27 02;
			ANDB <$09		;F952: D4 09;
$F954			STAB <$14		;F954: D7 14;
			LDAB <$15		;F956: D6 15;
			CMPA <$0A		;F958: 91 0A;
			BHI $F96E		;F95A: 22 12;
			DEX			;F95C: 09;
			BEQ $F985		;F95D: 27 26;
			STAA >$0400		;F95F: B7 04 00;
			ADDB <$15		;F962: DB 15;
			ADCA <$14		;F964: 99 14;
			BCS $F97E		;F966: 25 16;
			CMPA <$0A		;F968: 91 0A;
			BLS $F95C		;F96A: 23 F0;
			BRA $F97E		;F96C: 20 10;
$F96E			DEX			;F96E: 09;
			BEQ $F985		;F96F: 27 14;
			STAA >$0400		;F971: B7 04 00;
			SUBB <$15		;F974: D0 15;
			SBCA <$14		;F976: 92 14;
			BCS $F97E		;F978: 25 04;
			CMPA <$0A		;F97A: 91 0A;
			BHI $F96E		;F97C: 22 F0;
$F97E			LDAA <$0A		;F97E: 96 0A;
			STAA >$0400		;F980: B7 04 00;
	 		BRA $F93E		;F983: 20 B9;
$F985			LDAB <$18		;F985: D6 18;
			BEQ $F93E		;F987: 27 B5;
			LDAA <$13		;F989: 96 13;
			LDAB <$15		;F98B: D6 15;
			LSRA			;F98D: 44;
			RORB			;F98E: 56;
			LSRA			;F98F: 44;
			RORB			;F990: 56;
			LSRA			;F991: 44;
			RORB			;F992: 56;
			COMA			;F993: 43;
			NEGB			;F994: 50;
			SBCA #$FF		;F995: 82 FF;
			ADDB <$15		;F997: DB 15;
			ADCA <$13		;F999: 99 13;
			STAB <$15		;F99B: D7 15;
			STAA <$13		;F99D: 97 13;
			BNE $F939		;F99F: 26 98;
			CMPB #$07		;F9A1: C1 07;
			BNE $F939		;F9A3: 26 94;
			RTS			;F9A5: 39;

$F9A6			LDAA #$FD		;F9A6: 86 FD     ;W vector
			STAA <$0F		;F9A8: 97 0F;
			LDX #$0064		;F9AA: CE 00 64;
			STX <$0B		;F9AD: DF 0B;
$F9AF			ADDB <$0C		;F9AF: DB 0C;
			LDAA <$11		;F9B1: 96 11;
			ADCA <$0B		;F9B3: 99 0B;
			STAA <$11		;F9B5: 97 11;
			LDX <$0B		;F9B7: DE 0B;
			BCS $F9BF		;F9B9: 25 04;
			BRA $F9BD		;F9BB: 20 00;
$F9BD			BRA $F9C2		;F9BD: 20 03;
$F9BF			INX			;F9BF: 08;
			BEQ $F9D3		;F9C0: 27 11;
			STX <$0B		;F9C2: DF 0B;
			ANDA #$0F		;F9C4: 84 0F;
			ADDA #$9A		;F9C6: 8B 9A;
			STAA <$10		;F9C8: 97 10;
			LDX <$0F		;F9CA: DE 0F;
			LDAA $00,X		;F9CC: A6 00;
			STAA >$0400		;F9CE: B7 04 00;
			BRA $F9AF		;F9D1: 20 DC;
$F9D3			RTS			;F9D3: 39;

$F9D4			CLRA			;F9D4: 4F        ;W vector
			STAA >$0400		;F9D5: B7 04 00;
			STAA <$11		;F9D8: 97 11;
$F9DA			CLRA			;F9DA: 4F;
			CMPA <$11		;F9DB: 91 11;
			BNE $F9E2		;F9DD: 26 03;
			COM >$0400		;F9DF: 73 04 00;
$F9E2			LDAB #$12		;F9E2: C6 12;
$F9E4			DECB			;F9E4: 5A;
			BNE $F9E4		;F9E5: 26 FD;
			INCA			;F9E7: 4C;
			BPL $F9DB		;F9E8: 2A F1;
			COM >$0400		;F9EA: 73 04 00;
			INC >$0011		;F9ED: 7C 00 11;
			BPL $F9DA		;F9F0: 2A E8;
			RTS			;F9F2: 39;

$F9F3			LDX #$0013		;F9F3: CE 00 13  ;W vector
$F9F6			CLR $00,X		;F9F6: 6F 00;
			INX			;F9F8: 08;
			CPX #$001B		;F9F9: 8C 00 1B;
			BNE $F9F6		;F9FC: 26 F8;
			LDAA #$40		;F9FE: 86 40;
			STAA <$13		;FA00: 97 13;
$FA02			LDX #$0013		;FA02: CE 00 13;
			LDAA #$80		;FA05: 86 80;
			STAA <$11		;FA07: 97 11;
			CLRB			;FA09: 5F;
$FA0A			LDAA $01,X		;FA0A: A6 01;
			ADDA $00,X		;FA0C: AB 00;
			STAA $01,X		;FA0E: A7 01;
			BPL $FA14		;FA10: 2A 02;
			ADDB <$11		;FA12: DB 11;
$FA14			LSR >$0011		;FA14: 74 00 11;
			INX			;FA17: 08;
			INX			;FA18: 08;
			CPX #$001B		;FA19: 8C 00 1B;
			BNE $FA0A		;FA1C: 26 EC;
			STAB >$0400		;FA1E: F7 04 00;
			INC >$0012		;FA21: 7C 00 12;
 			BNE $FA02		;FA24: 26 DC;
			LDX #$0013		;FA26: CE 00 13;
			CLRB			;FA29: 5F;
$FA2A			LDAA $00,X		;FA2A: A6 00;
			BEQ $FA39		;FA2C: 27 0B;
			CMPA #$37		;FA2E: 81 37;
			BNE $FA36		;FA30: 26 04;
			LDAB #$41		;FA32: C6 41;
			STAB $02,X		;FA34: E7 02;
$FA36			DEC $00,X		;FA36: 6A 00;
			INCB			;FA38: 5C;
$FA39			INX			;FA39: 08;
			INX			;FA3A: 08;
			CPX #$001B		;FA3B: 8C 00 1B;
			BNE $FA2A		;FA3E: 26 EA;
			TSTB			;FA40: 5D;
			BNE $FA02		;FA41: 26 BF;
			RTS			;FA43: 39;

Will I ever know why this was made into a subroutine?

$FA44			DEC >$0008		;FA44: 7A 00 08  ;W vector
			RTS			;FA47: 39;

$FA48			CLR >$0008		;FA48: 7F 00 08  ;SUBRTN
			STAA <$11		;FA4B: 97 11     ;store the countdown value
			LDX #$FDAA		;FA4D: CE FD AA  ;starting point always the same, $FDAA
$FA50			LDAA $00,X		;FA50: A6 00     ;
			BEQ $FA81		;FA52: 27 2D     ;get out on a zero
			DEC >$0011		;FA54: 7A 00 11;
			BEQ $FA5F		;FA57: 27 06     ;exit the loop when countdown has reached zero
			INCA			;FA59: 4C;
			JSR CalcOfst            ;FA5A: BD FD 21  ;adjust X by A
			BRA $FA50		;FA5D: 20 F1     ;loop until an exit condition is encountered
$FA5F			INX			;FA5F: 08;
			STX <$0F		;FA60: DF 0F;
			JSR CalcOfst		;FA62: BD FD 21  ;adjust X by A
			STX <$0D		;FA65: DF 0D;
			LDX <$0F		;FA67: DE 0F;
$FA69			LDAA $00,X		;FA69: A6 00;
			STAA <$15		;FA6B: 97 15;
			LDAA $01,X		;FA6D: A6 01;
			LDX $02,X		;FA6F: EE 02;
			STX <$13		;FA71: DF 13;
			BSR $FAB3		;FA73: 8D 3E;
			LDX <$0F		;FA75: DE 0F;
			INX			;FA77: 08;
			INX			;FA78: 08;
			INX			;FA79: 08;
			INX			;FA7A: 08;
			STX <$0F		;FA7B: DF 0F;
			CPX <$0D		;FA7D: 9C 0D;
			BNE $FA69		;FA7F: 26 E8;
$FA81			JMP $FD0E		;FA81: 7E FD 0E;

Are you kidding? A subroutine to do this?

$FA84			LDAA #$03		;FA84: 86 03     ;W vector
			STAA <$08		;FA86: 97 08     ;initiating a count?
			RTS			;FA88: 39;

$FA89			DEC >$0008		;FA89: 7A 00 08; SUBRTN
			BEQ $FA9A		;FA8C: 27 0C;
			LDAB <$15		;FA8E: D6 15;
			ASLB			;FA90: 58;
			ASLB			;FA91: 58;
			ASLB			;FA92: 58;
			ASLB			;FA93: 58;
			ABA			;FA94: 1B;
			STAA <$15		;FA95: 97 15;
			CLRA			;FA97: 4F;
$FA98			BRA $FA98		;FA98: 20 FE;
$FA9A			DECA			;FA9A: 4A;
			CMPA #$0B		;FA9B: 81 0B;
			BLS $FAA0		;FA9D: 23 01;
			CLRA			;FA9F: 4F;
$FAA0			LDX #$FE41		;FAA0: CE FE 41;
			JSR CalcOfst		;FAA3: BD FD 21;
			LDAA $00,X		;FAA6: A6 00;
			LDX #$FFFF		;FAA8: CE FF FF;
			STX <$13		;FAAB: DF 13;
			BSR $FAB3		;FAAD: 8D 04;
$FAAF			BSR $FADB		;FAAF: 8D 2A;
			BRA $FAAF		;FAB1: 20 FC;

$FAB3			LDX #$0016		;FAB3: CE 00 16; SUBRTN
$FAB6			CMPA #$00		;FAB6: 81 00;
			BEQ $FACF		;FAB8: 27 15;
			CMPA #$03		;FABA: 81 03;
			BEQ $FAC7		;FABC: 27 09;
			LDAB #$01		;FABE: C6 01;
			STAB $00,X		;FAC0: E7 00;
			INX			;FAC2: 08;
			SUBA #$02		;FAC3: 80 02;
			BRA $FAB6		;FAC5: 20 EF;
$FAC7			LDAB #$91		;FAC7: C6 91;
			STAB $00,X		;FAC9: E7 00;
			CLR $01,X		;FACB: 6F 01;
			INX			;FACD: 08;
			INX			;FACE: 08;
$FACF			LDAB #$7E		;FACF: C6 7E;
			STAB $00,X		;FAD1: E7 00;
			LDAB #$FA		;FAD3: C6 FA;
			STAB $01,X		;FAD5: E7 01;
			LDAB #$DD		;FAD7: C6 DD;
			STAB $02,X		;FAD9: E7 02;
$FADB			LDX <$13		;FADB: DE 13; SUBRTN
			CLRA			;FADD: 4F;
			LDAB >$0012		;FADE: F6 00 12;
			INCB			;FAE1: 5C;
			STAB <$12		;FAE2: D7 12;
			ANDB <$15		;FAE4: D4 15;
			LSRB			;FAE6: 54;
			ADCA #$00		;FAE7: 89 00;
			LSRB			;FAE9: 54;
			ADCA #$00		;FAEA: 89 00;
			LSRB			;FAEC: 54;
			ADCA #$00		;FAED: 89 00;
			LSRB			;FAEF: 54;
			ADCA #$00		;FAF0: 89 00;
			LSRB			;FAF2: 54;
			ADCA #$00		;FAF3: 89 00;
			LSRB			;FAF5: 54;
 			ADCA #$00		;FAF6: 89 00;
			LSRB			;FAF8: 54;
			ADCA #$00		;FAF9: 89 00;
			ABA			;FAFB: 1B;
			ASLA			;FAFC: 48;
			ASLA			;FAFD: 48;
			ASLA			;FAFE: 48;
			ASLA			;FAFF: 48;
			STAA >$0400		;FB00: B7 04 00;
			DEX			;FB03: 09;
			BEQ $FB09		;FB04: 27 03;
			JMP $0016		;FB06: 7E 00 16;
$FB09			RTS			;FB09: 39;

$FB0A			PSHA			;FB0A: 36        ;SUBRTN
$FB0B			LDAA $00,X		;FB0B: A6 00     ;load byte from X address
			STX <$0D		;FB0D: DF 0D     ;save it
			LDX <$0F		;FB0F: DE 0F     ;load address to write to
			STAA $00,X		;FB11: A7 00     ;write it
			INX			;FB13: 08        ;advance the write pointer
			STX <$0F		;FB14: DF 0F     ;store the updated pointer
			LDX <$0D		;FB16: DE 0D     ;get the source address back
			INX			;FB18: 08        ;advance source as well
			DECB			;FB19: 5A        ;decrement counter
			BNE $FB0B		;FB1A: 26 EF     ;loop if not done yet
			PULA			;FB1C: 32        ;get A reg contents back
			RTS			;FB1D: 39        ;return to caller

$FB1E			CLRA			;FB1E: 4F        ;W vector
			STAA <$04		;FB1F: 97 04;
			STAA <$05		;FB21: 97 05;
			RTS			;FB23: 39;

$FB24			CLR >$0004		;FB24: 7F 00 04  ;W vector
			LDAA <$05		;FB27: 96 05;
			ANDA #$7F		;FB29: 84 7F;
			CMPA #$1D		;FB2B: 81 1D;
			BNE $FB30		;FB2D: 26 01;
			CLRA			;FB2F: 4F;
$FB30			INCA			;FB30: 4C;
			STAA <$05		;FB31: 97 05;
			RTS			;FB33: 39;
			LDAA #$0E		;FB34: 86 0E;
			JSR $FB81		;FB36: BD FB 81;
			LDAA <$05		;FB39: 96 05;
			ASLA			;FB3B: 48;
			ASLA			;FB3C: 48;
			COMA			;FB3D: 43;
			JSR $FC39		;FB3E: BD FC 39;
$FB41			INC >$0017		;FB41: 7C 00 17;
			JSR $FC3B		;FB44: BD FC 3B;
			BRA $FB41		;FB47: 20 F8;

$FB49			LDAA #$03		;FB49: 86 03     ;W vector, get third set from table
			JSR $F82A		;FB4B: BD F8 2A  ;go write it out from ROM
			LDAB <$06		;FB4E: D6 06     ;
			CMPB #$1F		;FB50: C1 1F     ;is it 31?
			BNE $FB55		;FB52: 26 01     ;if not, go on
			CLRB			;FB54: 5F        ;if it is, then set it to 0
$FB55			INCB			;FB55: 5C        ;increment it
			STAB <$06		;FB56: D7 06     ;store updated value
			LDAA #$20		;FB58: 86 20     ;
			SBA			;FB5A: 10        ;
			CLRB			;FB5B: 5F;
$FB5C			CMPA #$14		;FB5C: 81 14;
			BLS $FB65		;FB5E: 23 05;
			ADDB #$0E		;FB60: CB 0E;
			DECA			;FB62: 4A;
			BRA $FB5C		;FB63: 20 F7;
$FB65			ADDB #$05		;FB65: CB 05;
			DECA			;FB67: 4A;
			BNE $FB65		;FB68: 26 FB;
			STAB <$13		;FB6A: D7 13;
$FB6C			JSR $F83F		;FB6C: BD F8 3F;
			BRA $FB6C		;FB6F: 20 FB;

$FB71			LDAA <$07		;FB71: 96 07     ;W vector
			BNE $FB7E		;FB73: 26 09;
			INC >$0007		;FB75: 7C 00 07;
			LDAA #$0D		;FB78: 86 0D;
			BSR $FB81		;FB7A: 8D 05;
			BRA $FBE7		;FB7C: 20 69;
$FB7E			JMP $FC2E		;FB7E: 7E FC 2E;

$FB81			TAB			;FB81: 16; SUBRTN
			ASLB			;FB82: 58;
			ABA			;FB83: 1B;
			ABA			;FB84: 1B;
			ABA			;FB85: 1B;
			LDX #$FEEC		;FB86: CE FE EC;
			JSR CalcOfst		;FB89: BD FD 21;
			LDAA $00,X		;FB8C: A6 00;
			TAB			;FB8E: 16;
			ANDA #$0F		;FB8F: 84 0F;
			STAA <$14		;FB91: 97 14;
			LSRB			;FB93: 54;
			LSRB			;FB94: 54;
			LSRB			;FB95: 54;
			LSRB			;FB96: 54;
			STAB <$13		;FB97: D7 13;
			LDAA $01,X		;FB99: A6 01;
			TAB			;FB9B: 16;
			LSRB			;FB9C: 54;
			LSRB			;FB9D: 54;
			LSRB			;FB9E: 54;
			LSRB			;FB9F: 54;
			STAB <$15		;FBA0: D7 15;
			ANDA #$0F		;FBA2: 84 0F;
			STAA <$11		;FBA4: 97 11;
			STX <$0B		;FBA6: DF 0B;
			LDX #$FE4D		;FBA8: CE FE 4D;
$FBAB			DEC >$0011		;FBAB: 7A 00 11;
			BMI $FBB8		;FBAE: 2B 08;
			LDAA $00,X		;FBB0: A6 00;
			INCA			;FBB2: 4C;
			JSR CalcOfst		;FBB3: BD FD 21;
			BRA $FBAB		;FBB6: 20 F3;
$FBB8			STX <$18		;FBB8: DF 18;
			JSR $FC75		;FBBA: BD FC 75;
			LDX <$0B		;FBBD: DE 0B;
			LDAA $02,X		;FBBF: A6 02;
			STAA <$1A		;FBC1: 97 1A;
			JSR $FC87		;FBC3: BD FC 87;
			LDX <$0B		;FBC6: DE 0B;
			LDAA $03,X		;FBC8: A6 03;
			STAA <$16		;FBCA: 97 16;
			LDAA $04,X		;FBCC: A6 04;
			STAA <$17		;FBCE: 97 17;
			LDAA $05,X		;FBD0: A6 05;
			TAB			;FBD2: 16;
			LDAA $06,X		;FBD3: A6 06;
			LDX #$FF55		;FBD5: CE FF 55;
			JSR CalcOfst		;FBD8: BD FD 21;
			TBA			;FBDB: 17;
			STX <$1B		;FBDC: DF 1B;
			CLR >$0023		;FBDE: 7F 00 23;
			JSR CalcOfst		;FBE1: BD FD 21;
			STX <$1D		;FBE4: DF 1D;
			RTS			;FBE6: 39;
$FBE7			LDAA <$13		;FBE7: 96 13;
			STAA <$22		;FBE9: 97 22;
$FBEB			LDX <$1B		;FBEB: DE 1B;
			STX <$0D		;FBED: DF 0D;
$FBEF			LDX <$0D		;FBEF: DE 0D;
			LDAA $00,X		;FBF1: A6 00;
			ADDA <$23		;FBF3: 9B 23;
			STAA <$21		;FBF5: 97 21;
			CPX <$1D		;FBF7: 9C 1D;
			BEQ $FC21		;FBF9: 27 26;
			LDAB <$14		;FBFB: D6 14;
			INX			;FBFD: 08;
			STX <$0D		;FBFE: DF 0D;
$FC00			LDX #$0024		;FC00: CE 00 24;
$FC03			LDAA <$21		;FC03: 96 21;
$FC05			DECA			;FC05: 4A;
			BNE $FC05		;FC06: 26 FD;
			LDAA $00,X		;FC08: A6 00;
			STAA >$0400		;FC0A: B7 04 00;
			INX			;FC0D: 08;
			CPX <$1F		;FC0E: 9C 1F;
			BNE $FC03		;FC10: 26 F1;
			DECB			;FC12: 5A;
			BEQ $FBEF		;FC13: 27 DA;
			INX			;FC15: 08;
			DEX			;FC16: 09;
			INX			;FC17: 08;
			DEX			;FC18: 09;
			INX			;FC19: 08;
			DEX			;FC1A: 09;
			INX			;FC1B: 08;
			DEX			;FC1C: 09;
			NOP			;FC1D: 01;
			NOP			;FC1E: 01;
			BRA $FC00		;FC1F: 20 DF;
$FC21			LDAA <$15		;FC21: 96 15;
			BSR $FC87		;FC23: 8D 62;
			DEC >$0022		;FC25: 7A 00 22;
			BNE $FBEB		;FC28: 26 C1;
			LDAA <$07		;FC2A: 96 07;
			BNE $FC74		;FC2C: 26 46;
$FC2E			LDAA <$16		;FC2E: 96 16;
			BEQ $FC74		;FC30: 27 42;
			DEC >$0017		;FC32: 7A 00 17;
			BEQ $FC74		;FC35: 27 3D;
			ADDA <$23		;FC37: 9B 23;
$FC39			STAA <$23		;FC39: 97 23; SUBRTN
$FC3B			LDX <$1B		;FC3B: DE 1B; SUBRTN
			CLRB			;FC3D: 5F;
$FC3E			LDAA <$23		;FC3E: 96 23;
			TST >$0016		;FC40: 7D 00 16;
			BMI $FC4B		;FC43: 2B 06;
			ADDA $00,X		;FC45: AB 00;
			BCS $FC51		;FC47: 25 08;
			BRA $FC56		;FC49: 20 0B;
$FC4B			ADDA $00,X		;FC4B: AB 00;
			BEQ $FC51		;FC4D: 27 02;
			BCS $FC56		;FC4F: 25 05;
$FC51			TSTB			;FC51: 5D;
			BEQ $FC5C		;FC52: 27 08;
			BRA $FC65		;FC54: 20 0F;
$FC56			TSTB			;FC56: 5D;
			BNE $FC5C		;FC57: 26 03;
			STX <$1B		;FC59: DF 1B;
			INCB			;FC5B: 5C;
$FC5C			INX			;FC5C: 08;
			CPX <$1D		;FC5D: 9C 1D;
			BNE $FC3E		;FC5F: 26 DD;
			TSTB			;FC61: 5D;
			BNE $FC65		;FC62: 26 01;
			RTS			;FC64: 39;

$FC65			STX <$1D		;FC65: DF 1D;
			LDAA <$15		;FC67: 96 15;
			BEQ $FC71		;FC69: 27 06;
			BSR $FC75		;FC6B: 8D 08;
			LDAA <$1A		;FC6D: 96 1A;
			BSR $FC87		;FC6F: 8D 16;
$FC71			JMP $FBE7		;FC71: 7E FB E7;
$FC74			RTS			;FC74: 39;

$FC75			LDX #$0024		;FC75: CE 00 24; SUBRTN
			STX <$0F		;FC78: DF 0F;
			LDX <$18		;FC7A: DE 18;
			LDAB $00,X		;FC7C: E6 00;
			INX			;FC7E: 08;
			JSR $FB0A		;FC7F: BD FB 0A;
			LDX <$0F		;FC82: DE 0F;
			STX <$1F		;FC84: DF 1F;
			RTS			;FC86: 39;

$FC87			TSTA			;FC87: 4D; SUBRTN
			BEQ $FCB5		;FC88: 27 2B;
			LDX <$18		;FC8A: DE 18;
			STX <$0D		;FC8C: DF 0D;
			LDX #$0024		;FC8E: CE 00 24;
			STAA <$12		;FC91: 97 12;
$FC93			STX <$0F		;FC93: DF 0F;
			LDX <$0D		;FC95: DE 0D;
			LDAB <$12		;FC97: D6 12;
			STAB <$11		;FC99: D7 11;
			LDAB $01,X		;FC9B: E6 01;
			LSRB			;FC9D: 54;
			LSRB			;FC9E: 54;
			LSRB			;FC9F: 54;
			LSRB			;FCA0: 54;
			INX			;FCA1: 08;
			STX <$0D		;FCA2: DF 0D;
			LDX <$0F		;FCA4: DE 0F;
			LDAA $00,X		;FCA6: A6 00;
$FCA8			SBA			;FCA8: 10;
			DEC >$0011		;FCA9: 7A 00 11;
			BNE $FCA8		;FCAC: 26 FA;
			STAA $00,X		;FCAE: A7 00;
			INX			;FCB0: 08;
			CPX <$1F		;FCB1: 9C 1F;
			BNE $FC93		;FCB3: 26 DE;
$FCB5			RTS			;FCB5: 39;

Interrupt request handler

IRQ			LDS #$007F		;FCB6: 8E 00 7F  ;VECTOR at $FFF8, toss int return values out
			LDAA >$0402		;FCB9: B6 04 02  ;read in from PIA channel B
			CLI			;FCBC: 0E        ;
			COMA			;FCBD: 43        ;flip the bits just read
			ANDA #$1F		;FCBE: 84 1F     ;mask out upper 3 bits
			LDAB <$08		;FCC0: D6 08;
			BEQ $FCCD		;FCC2: 27 09;
			BPL $FCC9		;FCC4: 2A 03;
			JSR $FA48		;FCC6: BD FA 48  ;do this if negative
$FCC9			DECA			;FCC9: 4A        ;start here greater that zero
			JSR $FA89		;FCCA: BD FA 89;
$FCCD			CLRB			;FCCD: 5F        ;jump here if it's zero
			CMPA #$0E		;FCCE: 81 0E;
			BEQ $FCD4		;FCD0: 27 02;
			STAB <$06		;FCD2: D7 06;
$FCD4			CMPA #$12		;FCD4: 81 12;
			BEQ $FCDA		;FCD6: 27 02;
			STAB <$07		;FCD8: D7 07;
$FCDA			LDAB >$EFFD		;FCDA: F6 EF FD; ???
			CMPB #$7E		;FCDD: C1 7E;
			BNE $FCE4		;FCDF: 26 03;
			JSR $EFFD		;FCE1: BD EF FD; ???
$FCE4			TSTA			;FCE4: 4D;
			BEQ $FD0E		;FCE5: 27 27;
			DECA			;FCE7: 4A;
			CMPA #$0C		;FCE8: 81 0C;
			BHI $FCF4		;FCEA: 22 08;
			JSR $FB81		;FCEC: BD FB 81;
			JSR $FBE7		;FCEF: BD FB E7;
			BRA $FD0E		;FCF2: 20 1A;
$FCF4			CMPA #$1B		;FCF4: 81 1B;
			BHI $FD06		;FCF6: 22 0E;
			SUBA #$0D		;FCF8: 80 0D;
			ASLA			;FCFA: 48        ;x 2 for an offset into the table
			LDX #$FD58		;FCFB: CE FD 58  ;address of VectorTblW table
			BSR CalcOfst		;FCFE: 8D 21     ;calculate offset into the table
			LDX $00,X		;FD00: EE 00     ;load the vector address from table
			JSR $00,X		;FD02: AD 00     ;call the subroutine
			BRA $FD0E		;FD04: 20 08     ;
$FD06			SUBA #$1C		;FD06: 80 1C;
			JSR $F82A		;FD08: BD F8 2A;
			JSR $F83F		;FD0B: BD F8 3F;

$FD0E			LDAA <$04		;FD0E: 96 04;
			ORAA <$05		;FD10: 9A 05;
$FD12			BEQ $FD12		;FD12: 27 FE;
			CLRA			;FD14: 4F;
			STAA <$07		;FD15: 97 07;
			LDAA <$04		;FD17: 96 04;
			BEQ $FD1E		;FD19: 27 03;
			JMP $F913		;FD1B: 7E F9 13;
$FD1E			JMP $FB34		;FD1E: 7E FB 34;
This subroutine calculates the unsigned offset of A + X and places the result in the X reg. The A reg is mangled by this function.
CalcOfst		STX <$0D		;FD21: DF 0D     ;SUBRTN, store index base value
			ADDA <$0E		;FD23: 9B 0E     ;add A reg to LSB of index base value
			STAA <$0E		;FD25: 97 0E     ;store that in same
			BCC $FD2C		;FD27: 24 03     ;if no carry, go on out of here
			INC >$000D		;FD29: 7C 00 0D  ;otherwise, inc the MSB of index base value. Why extended addressing mode?
$FD2C			LDX <$0D		;FD2C: DE 0D     ;load up the modified index value
			RTS			;FD2E: 39;

NMI			SEI			;FD2F: 0F; VECTOR at $FFFC
			LDS #$007F		;FD30: 8E 00 7F;
			LDX #$FFFF		;FD33: CE FF FF;
			CLRB			;FD36: 5F;
			ADCB $00,X		;FD37: E9 00;
			DEX			;FD39: 09;
			CPX #$F800		;FD3A: 8C F8 00;
			BNE $FD37		;FD3D: 26 F8;
			CMPB $00,X		;FD3F: E1 00;
			BEQ $FD44		;FD41: 27 01;
			WAI			;FD43: 3E;
			LDAA #$01		;FD44: 86 01;
			JSR $F82A		;FD46: BD F8 2A;
			JSR $F83F		;FD49: BD F8 3F;
			LDAB >$EFFA		;FD4C: F6 EF FA; ???
			CMPB #$7E		;FD4F: C1 7E;
			BNE NMI 		;FD51: 26 DC;
			JSR $EFFA		;FD53: BD EF FA; ???
			BRA NMI 		;FD56: 20 D7;

W vector table here

VectorTblW         FDB  $FB49                   ;FD58: FB 49
                   FDB  $F913                   ;FD5A: F9 13
                   FDB  $FB24                   ;FD5C: FB 24
                   FDB  $F88C                   ;FD5E: F8 8C
                   FDB  $FB71                   ;FD60: FB 71
                   FDB  $FB1E                   ;FD62: FB 1E
                   FDB  $F8CD                   ;FD64: F8 CD
                   FDB  $F894                   ;FD66: F8 94
                   FDB  $F91C                   ;FD68: F9 1C
                   FDB  $F923                   ;FD6A: F9 23
                   FDB  $F9A6                   ;FD6C: F9 A6
                   FDB  $F9D4                   ;FD6E: F9 D4
                   FDB  $F9F3                   ;FD70: F9 F3
                   FDB  $FA44                   ;FD72: FA 44
                   FDB  $FA84                   ;FD74: FA 84


FD76:                    40 01  00 10 e1 00 80 ff ff 28  |...D..@........(|
FD80:  01 00 08 81 02 00 ff ff  28 81 00 fc 01 02 00 fc  |........(.......|
FD90:  ff ff 01 00 18 41 04 80  00 ff 8c 5b b6 40 bf 49  |.....A.....[.@.I|
FDA0:  a4 73 73 a4 49 bf 40 b6  5b 8c 0c 7f 1d 0f fb 7f  |.ss.I.@.[.......|
FDB0:  23 0f 15 fe 08 50 8b 88  3e 3f 02 3e 7c 04 03 ff  |#....P..>?.>|...|
FDC0:  3e 3f 2c e2 7c 12 0d 74  7c 0d 0e 41 7c 23 0b 50  |>?,.|..t|..A|#.P|
FDD0:  7c 1d 29 f2 7c 3f 02 3e  f8 04 03 ff 7c 3f 2c e2  ||.).|?.>....|?,.|
FDE0:  f8 12 0d 74 f8 0d 0e 41  f8 23 0b 50 f8 1d 2f f2  |...t...A.#.P../.|
FDF0:  f8 23 05 a8 f8 12 06 ba  f8 04 07 ff 7c 37 04 c1  |.#..........|7..|
FE00:  7c 23 05 a8 7c 12 06 ba  3e 04 07 ff 3e 37 04 c1  ||#..|...>...>7..|
FE10:  3e 23 05 a8 1f 12 06 ba  1f 04 07 ff 1f 37 04 c1  |>#...........7..|
FE20:  1f 23 16 a0 fe 1d 17 f9  7f 37 13 06 7f 3f 08 fa  |.#.......7...?..|
FE30:  fe 04 0f ff fe 0d 0e 41  fe 23 0b 50 fe 1d 5f e4  |.......A.#.P.._.|
FE40:  00 47 3f 37 30 29 23 1d  17 12 0d 08 04 08 7f d9  |.G?70)#.........|
FE50:  ff d9 7f 24 00 24 08 00  40 80 00 ff 00 80 40 10  |...$.$..@.....@.|
FE60:  7f b0 d9 f5 ff f5 d9 b0  7f 4e 24 09 00 09 24 4e  |.........N$...$N|
FE70:  10 7f c5 ec e7 bf 8d 6d  6a 7f 94 92 71 40 17 12  |.......mj...q@..|
FE80:  39 10 ff ff ff ff 00 00  00 00 ff ff ff ff 00 00  |9...............|
FE90:  00 00 48 8a 95 a0 ab b5  bf c8 d1 da e1 e8 ee f3  |..H.............|
FEA0:  f7 fb fd fe ff fe fd fb  f7 f3 ee e8 e1 da d1 c8  |................|
FEB0:  bf b5 ab a0 95 8a 7f 75  6a 5f 54 4a 40 37 2e 25  |.......uj_TJ@7.%|
FEC0:  1e 17 11 0c 08 04 02 01  00 01 02 04 08 0c 11 17  |................|
FED0:  1e 25 2e 37 40 4a 54 5f  6a 75 7f 10 59 7b 98 ac  |.%.7@JT_ju..Y{..|
FEE0:  b3 ac 98 7b 59 37 19 06  00 06 19 37 81 24 00 00  |...{Y7.....7.$..|
FEF0:  00 16 31 12 05 1a ff 00  27 6d 11 05 11 01 0f 01  |..1.....'m......|
FF00:  47 11 31 00 01 00 0d 1b  f4 12 00 00 00 14 47 41  |G.1...........GA|
FF10:  45 00 00 00 0f 5b 21 35  11 ff 00 0d 1b 15 00 00  |E....[!5........|
FF20:  fd 00 01 69 31 11 00 01  00 03 6a 01 15 01 01 01  |...i1.....j.....|
FF30:  01 47 f6 53 03 00 02 06  94 6a 10 02 00 02 06 9a  |.G.S.....j......|
FF40:  1f 12 00 ff 10 04 69 31  11 00 ff 00 0d 00 12 06  |......i1........|
FF50:  00 ff 01 09 28 a0 98 90  88 80 78 70 68 60 58 50  |....(.....xph`XP|
FF60:  44 40 01 01 02 02 04 04  08 08 10 10 30 60 c0 e0  |D@..........0`..|
FF70:  01 01 02 02 03 04 05 06  07 08 09 0a 0c 80 7c 78  |..............|x|
FF80:  74 70 74 78 7c 80 01 01  02 02 04 04 08 08 10 20  |tptx|.......... |
FF90:  28 30 38 40 48 50 60 70  80 a0 b0 c0 08 40 08 40  |(08@HP`p.....@.@|
FFA0:  08 40 08 40 08 40 08 40  08 40 08 40 08 40 08 40  |.@.@.@.@.@.@.@.@|
FFB0:  01 02 04 08 09 0a 0b 0c  0e 0f 10 12 14 16 40 10  |..............@.|
FFC0:  08 01 01 01 01 01 02 02  03 03 04 04 05 06 08 0a  |................|
FFD0:  0c 10 14 18 20 30 40 50  40 30 20 10 0c 0a 08 07  |.... 0@P@0 .....|
FFE0:  06 05 04 03 02 02 01 01  01 07 08 09 0a 0c 08 17  |................|
FFF0:  18 19 1a 1b 1c 00 00 00  
Motorola vector table settings
FFF8: FC B6    FDB   IRQ
FFFA: F8 01    FDB   RESET (SWI)
FFFC: FD 2F    FDB   NMI
FFFE: F8 01    FDB   RESET (ColdStart)