ca65 V2.13.3 - (C) Copyright 1998-2012 Ullrich von Bassewitz
Main file   : main.s
Current file: main.s

000000r 1               ;-------------------------------------------------------------------------
000000r 1               ; APPLE ][ SERIES ANNUNCIATOR MIDI DRIVER
000000r 1               ; Copyright © 1998-2018 Eric Rangell. MIT License.
000000r 1               ;-------------------------------------------------------------------------;
000000r 1               ;  main.s
000000r 1               ;  A2NoSlotMidi
000000r 1               ;  Created by Eric Rangell on 17 JULY 2018.
000000r 1               ;  VERSION 1.0.1 released 26 JULY 2018
000000r 1               ;  VERSION 1.0.2 released 29 JULY 2018
000000r 1               ;-------------------------------------------------------------------------
000000r 1               ; THIS DRIVER IMPLEMENTS ASYNCHRONOUS SERIAL DATA TRANSMISSION
000000r 1               ; THROUGH AN APPLE ][ ANNUNCIATOR OUTPUT PORT OF THE GAME CONNECTOR
000000r 1               ; USING 32 CYCLES PER BIT TO ACHIEVE A 31.25K MIDI BAUD RATE.
000000r 1               ;
000000r 1               ; APPLE //GS USERS NEED TO RUN THIS PROGRAM IN NORMAL SPEED MODE (1MHZ)
000000r 1               ;
000000r 1               ; THE OUTPUT IS INITIALIZED TO A HIGH LOGIC VOLTAGE.  WHEN IT GOES
000000r 1               ; LOW FOR 32 MICROSECONDS, THAT INDICATES THE START BIT OF A MIDI BYTE.
000000r 1               ; THEN 8 BYTES OF DATA ARE TRANSMITTED, FOLLOWED BY A HIGH STOP BIT.
000000r 1               ; THE DATA BYTES REPRESENT MIDI MESSAGES WHICH CAN BE INTERPRETED BY
000000r 1               ; ANY MUSICAL INSTRUMENT THAT IMPLEMENTS MIDI.
000000r 1               ;
000000r 1               ; ENTRY POINTS: (Note: Origin must be set in Makefile)
000000r 1               ;
000000r 1               ; $9000 = INITIALIZE - TURNS ON ANNUNCIATOR 0 - MUST BE CALLED ONCE
000000r 1               ; $9003 = APPLESOFT CALL TO SEND ONE MIDI BYTE.  POKE THE BYTE IN $9004.
000000r 1               ; $9005 = ASSEMBLY CALL TO SEND ONE MIDI BYTE FROM ACCUMULATOR
000000r 1               ; $9008 = APPLESOFT OR ASSEMBLY CALL TO SEND SEVERAL BYTES AT ONCE:
000000r 1               ;         THE CALLER POPULATES LOCATION $D7 WITH THE NUMBER OF BYTES TO BE
000000r 1               ;         TRANSMITTED, AND A POINTER IN $CE,CF (LO,HI) WITH THE ADDRESS OF
000000r 1               ;         THE DATA BYTES, THEN CALLS THE ENTRY POINT "SENDMSG" TO TRANSMIT
000000r 1               ;         THE MESSAGE.
000000r 1               ; $900B = TURN ALL NOTES OFF
000000r 1               ; $900E = SEND A TEST MESSAGE - C MAJOR CHORD NOTE ONS
000000r 1               ; $9011 = SEND A TEST MESSAGE - C MAJOR CHORD NOTE OFFS
000000r 1               ;
000000r 1               ; IF THE FOLLOWING ROUTINE IS USED, IT SHOULD BE CALLED IMMEDIATELY AFTER BLOADING
000000r 1               ; THE BINARY.  AT THE END, IT WILL CALL THE INIT ROUTINE FOR THE SELECTED ANNUNCIATOR.
000000r 1               ;
000000r 1               ; $9014 = CHANGE ANNUNCIATOR - MODIFIES CODE TO USE DIFFERENT ANNUNCIATOR
000000r 1               ; $9017 = ANNUNCIATOR TO USE: 0-3 - only looks at least significant 2 bits
000000r 1               ;
000000r 1               ; $9018 = SET TO 1 TO USE NEGATIVE LOGIC (ONLY ONE INVERTER IN THE MIDI CIRCUIT)
000000r 1               ;-------------------------------------------------------------------------
000000r 1               ; Enhancements for 2018:
000000r 1               ; 1. Disable interrupts during critical timing sections, preserve interrupt status
000000r 1               ; 2. Entry point to reconfigure program to use a different annunciator pair
000000r 1               ; 3. Entry point to reconfigure program for hardware interface using inverters only (not buffers)
000000r 1               ;-------------------------------------------------------------------------
000000r 1               ; CALLER MUST POPULATE THE FOLLOWING TWO ZERO PAGE LOCATIONS FOR SENDMSG:
000000r 1               NUMBYTES = $D7             ;NUMBER OF BYTES TO BE TRANSMITTED NOW (1-256)
000000r 1               ;                          ;THE VALUE 0 WILL TRANSMIT 256 BYTES.
000000r 1               DATAPTR  = $CE             ;POINTER TO THE BYTES TO BE TRANSMITTED NOW
000000r 1               ;-------------------------------------------------------------------------
000000r 1               AN0OFF   = $C058           ;APPLE ADDRESSES THAT CONTROL ANNUNCIATOR OUTPUTS
000000r 1               AN0ON    = $C059           ;PROGRAM REFERNCES ARE RELATIVE TO AN0
000000r 1               ;AN1OFF   = $C05A
000000r 1               ;AN1ON    = $C05B
000000r 1               ;AN2OFF   = $C05C
000000r 1               ;AN2ON    = $C05D
000000r 1               ;AN3OFF   = $C05E
000000r 1               ;AN3ON    = $C05F
000000r 1               ;-------------------------------------------------------------------------
000000r 1               .proc main
000000r 1               ;---------------------------------------------------------------------------
000000r 1               START:
000000r 1  4C rr rr             JMP INIT            ;MAIN ENTRY POINT - INITIALIZES ANNUNCIATORS
000003r 1               SENDFP:
000003r 1  A9 90                LDA #$90            ;ENTRY POINT FOR APPLESOFT: POKE BYTE AND CALL
000005r 1               SENDONE:
000005r 1  4C rr rr             JMP XMITONE         ;ENTRY POINT FOR TRANSMITTING ONE BYTE FROM ACCUM
000008r 1               SENDMSG:
000008r 1  4C rr rr             JMP XMITMSG         ;ENTRY POINT FOR TRANSMITTING A MIDI MESSAGE
00000Br 1               ALLNOFF:
00000Br 1  4C rr rr             JMP QUIET           ;TURN ALL NOTES OFF
00000Er 1               TEST1:
00000Er 1  4C rr rr             JMP TESTMSG1        ;SEND TEST MESSAGE 1 - C MAJOR CHORD ON
000011r 1               TEST2:
000011r 1  4C rr rr             JMP TESTMSG2        ;SEND TEST MESSAGE 2 - C MAJOR CHORD OFF
000014r 1               CHNGANNC:
000014r 1  4C rr rr             JMP CHGANNC         ;RECONFIGURE PROGRAM TO USE ANNUNCIATOR NUMBER IN NEXT BYTE
000017r 1               ANNC2USE:
000017r 1  00                   .byte $00           ;ONLY LEAST SIGNIFICANT 2 BITS ARE USED
000018r 1               NEGLOGIC:
000018r 1  00                   .byte $00           ;SET TO 1 TO USE NEGATIVE LOGIC, OTHERWISE LEAVE 0 FOR POSITIVE LOGIC (DEFAULT). DO NOT USE ANY OTHER VALUES!
000019r 1               ;---------------------------------------------------------------------------
000019r 1  01           MAJVER:     .byte $01       ;BYTES USED TO TRACK VERSION OF RELEASED EXECUTABLES
00001Ar 1  02           MINVER:     .byte $02       ;NIBBLES ARE USED FOR THE VERSION NUMBER ($0102 = VERSION 1.0.2)
00001Br 1  00           ASAVE:      .byte $00       ;SAVE AREA FOR ACCUMULATOR
00001Cr 1  00           SAVENBYT:   .byte $00       ;SAVE AREA FOR NUMBYTES
00001Dr 1               ;---------------------------------------------------------------------------
00001Dr 1  AD rr rr     INIT:   LDA NEGLOGIC
000020r 1  29 FE                AND #$FE
000022r 1  F0 01                BEQ OK2INIT
000024r 1  00                   BRK                 ;ABEND IF NEGLOGIC NOT 0 OR 1
000025r 1               OK2INIT:
000025r 1  A9 59                LDA #<AN0ON         ;MODIFY BIT INSTRUCTION BELOW - FLIP LEAST SIGNIFICANT BIT IF NEGATIVE LOGIC
000027r 1  4D rr rr             EOR NEGLOGIC
00002Ar 1  8D rr rr             STA INITANNC+1
00002Dr 1               INITANNC:
00002Dr 1  2C 59 C0             BIT AN0ON
000030r 1  60                   RTS
000031r 1               ;---------------------------------------------------------------------------
000031r 1               ; CRITICAL TIMING SECTION BELOW MUST NOT CROSS A PAGE BOUNDARY
000031r 1               ;---------------------------------------------------------------------------
000031r 1               XMITBITS:
000031r 1  08                   PHP                 ;SAVE CURRENT INTERRUPT STATUS
000032r 1  78                   SEI                 ;MASK INTERRUPTS DURING CRITICAL TIMING SECTION
000033r 1               STRTBIT:
000033r 1  2C 58 C0             BIT AN0OFF          ;4 CYCLES - TRANSMIT START BIT - ALWAYS LOW
000036r 1  20 rr rr             JSR DELAY22         ;6+22
000039r 1               BIT0:
000039r 1  2C 58 C0             BIT AN0OFF          ;4
00003Cr 1  20 rr rr             JSR DELAY22         ;6+22
00003Fr 1               BIT1:
00003Fr 1  2C 58 C0             BIT AN0OFF          ;4
000042r 1  20 rr rr             JSR DELAY22         ;6+22
000045r 1               BIT2:
000045r 1  2C 58 C0             BIT AN0OFF          ;4
000048r 1  20 rr rr             JSR DELAY22         ;6+22
00004Br 1               BIT3:
00004Br 1  2C 58 C0             BIT AN0OFF          ;4
00004Er 1  20 rr rr             JSR DELAY22         ;6+22
000051r 1               BIT4:
000051r 1  2C 58 C0             BIT AN0OFF          ;4
000054r 1  20 rr rr             JSR DELAY22         ;6+22
000057r 1               BIT5:
000057r 1  2C 58 C0             BIT AN0OFF          ;4
00005Ar 1  20 rr rr             JSR DELAY22         ;6+22
00005Dr 1               BIT6:
00005Dr 1  2C 58 C0             BIT AN0OFF          ;4
000060r 1  20 rr rr             JSR DELAY22         ;6+22
000063r 1               BIT7:
000063r 1  2C 58 C0             BIT AN0OFF          ;4
000066r 1  20 rr rr             JSR DELAY22         ;6+22
000069r 1               STOPBIT:
000069r 1  2C 59 C0             BIT AN0ON           ;4        ;TRANSMIT STOP BIT - ALWAYS HIGH
00006Cr 1  20 rr rr             JSR DELAY22         ;6+22
00006Fr 1  28                   PLP                 ;4        ;RESTORE SAVED INTERRUPT STATUS
000070r 1  60                   RTS                 ;TOTAL TIME INTERRUPTS DISABLED: 324 MICROSECONDS
000071r 1               ;-----------------------------------------------------------------------
000071r 1               DELAY22:
000071r 1  EA                   NOP       ;WAIT 22 CYCLES
000072r 1  EA                   NOP
000073r 1  EA                   NOP
000074r 1  EA                   NOP
000075r 1  EA                   NOP
000076r 1  EA                   NOP
000077r 1  EA                   NOP
000078r 1  EA                   NOP
000079r 1  60                   RTS
00007Ar 1               ;---------------------------------------------------------------------------
00007Ar 1               XMITMSG:
00007Ar 1  A5 D7                LDA NUMBYTES        ;SAVE NUMBER OF BYTES
00007Cr 1  8D rr rr             STA SAVENBYT        ;BECAUSE WE WILL CLOBBER IT
00007Fr 1  A0 00                LDY #$00            ;Y WILL BE AN INDEX INTO THE DATA AREA
000081r 1               XMITLOOP:
000081r 1  B1 CE                LDA (DATAPTR),Y     ;GET A DATA BYTE
000083r 1  20 rr rr             JSR XMITONE
000086r 1  C8                   INY                 ;POINT TO NEXT BYTE
000087r 1  C6 D7                DEC NUMBYTES        ;DECREMENT COUNTER
000089r 1  A5 D7                LDA NUMBYTES        ;CHECK IF ZERO
00008Br 1  D0 F4                BNE XMITLOOP        ;LOOP UNTIL DONE SENDING ALL BYTES
00008Dr 1  AD rr rr             LDA SAVENBYT
000090r 1  85 D7                STA NUMBYTES        ;RESTORE ORIGINAL VALUE OF NUMBYTES
000092r 1  60                   RTS
000093r 1               ;---------------------------------------------------------------------------
000093r 1               XMITONE:
000093r 1  8D rr rr             STA ASAVE           ;ABEND IF NEGLOGIC NOT 0 OR 1
000096r 1  AD rr rr             LDA NEGLOGIC
000099r 1  29 FE                AND #$FE
00009Br 1  F0 04                BEQ OK2XMIT
00009Dr 1  AD rr rr             LDA ASAVE
0000A0r 1  00                   BRK
0000A1r 1               OK2XMIT:
0000A1r 1  8A                   TXA                 ;SAVE X AND A ON STACK IN CASE THIS CODE GETS INTERRUPTED
0000A2r 1  48                   PHA
0000A3r 1  AD rr rr             LDA ASAVE
0000A6r 1  48                   PHA
0000A7r 1               ;
0000A7r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000A8r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000A9r 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000ABr 1  69 58        MOD1:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000ADr 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000B0r 1  8D rr rr             STA BIT7+1          ;MODIFY THE XMITBITS SUBROUTINE
0000B3r 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000B4r 1               ;
0000B4r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000B5r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000B6r 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000B8r 1  69 58        MOD2:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000BAr 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000BDr 1  8D rr rr             STA BIT6+1          ;MODIFY THE XMITBITS SUBROUTINE
0000C0r 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000C1r 1               ;
0000C1r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000C2r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000C3r 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000C5r 1  69 58        MOD3:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000C7r 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000CAr 1  8D rr rr             STA BIT5+1          ;MODIFY THE XMITBITS SUBROUTINE
0000CDr 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000CEr 1               ;
0000CEr 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000CFr 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000D0r 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000D2r 1  69 58        MOD4:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000D4r 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000D7r 1  8D rr rr             STA BIT4+1          ;MODIFY THE XMITBITS SUBROUTINE
0000DAr 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000DBr 1               ;
0000DBr 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000DCr 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000DDr 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000DFr 1  69 58        MOD5:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000E1r 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000E4r 1  8D rr rr             STA BIT3+1          ;MODIFY THE XMITBITS SUBROUTINE
0000E7r 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000E8r 1               ;
0000E8r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000E9r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000EAr 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000ECr 1  69 58        MOD6:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000EEr 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000F1r 1  8D rr rr             STA BIT2+1          ;MODIFY THE XMITBITS SUBROUTINE
0000F4r 1  8A                   TXA                 ;RESTORE ACCUMULATOR
0000F5r 1               ;
0000F5r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
0000F6r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
0000F7r 1  A9 00                LDA #$00            ;ZERO OUT ACCUMULATOR FOR ADD
0000F9r 1  69 58        MOD7:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
0000FBr 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
0000FEr 1  8D rr rr             STA BIT1+1          ;MODIFY THE XMITBITS SUBROUTINE
000101r 1  8A                   TXA                 ;RESTORE ACCUMULATOR
000102r 1               ;
000102r 1  0A                   ASL A               ;SHIFT BIT INTO CARRY
000103r 1  AA                   TAX                 ;SAVE CURRENT IMAGE OF DATA BYTE
000104r 1  A9 00                LDA #$00             ;ZERO OUT ACCUMULATOR FOR ADD
000106r 1  69 58        MOD8:   ADC #<AN0OFF        ;ADD CARRY TO ANNUNCIATOR ADDRESS
000108r 1  4D rr rr             EOR NEGLOGIC        ;FLIP ADDRESSES IF USING NEGATIVE LOGIC
00010Br 1  8D rr rr             STA BIT0+1          ;MODIFY THE XMITBITS SUBROUTINE
00010Er 1  8A                   TXA                 ;RESTORE ACCUMULATOR
00010Fr 1               ;
00010Fr 1  A9 58        MOD9:   LDA #<AN0OFF       ;FLIP ANNUNCIATOR ADDRESSES OF START AND STOP BITS IF USING NEGATIVE LOGIC
000111r 1  4D rr rr             EOR NEGLOGIC
000114r 1  8D rr rr             STA STRTBIT+1
000117r 1               ;
000117r 1  A9 59        MOD10:  LDA #<AN0ON
000119r 1  4D rr rr             EOR NEGLOGIC
00011Cr 1  8D rr rr             STA STOPBIT+1
00011Fr 1               ;
00011Fr 1  20 rr rr             JSR XMITBITS        ;SEND THE BYTE OUT
000122r 1  68                   PLA                 ;RESTORE A AND X
000123r 1  8D rr rr             STA ASAVE
000126r 1  68                   PLA
000127r 1  AA                   TAX
000128r 1  AD rr rr             LDA ASAVE
00012Br 1  60                   RTS
00012Cr 1               ;-----------------------------------------------------------------------
00012Cr 1               TESTMSG1:
00012Cr 1  A9 07                LDA #7
00012Er 1  85 D7                STA NUMBYTES
000130r 1  A9 rr                LDA #<TESTDAT1
000132r 1  85 CE                STA DATAPTR
000134r 1  A9 rr                LDA #>TESTDAT1
000136r 1  85 CF                STA DATAPTR+1
000138r 1  20 rr rr             JSR SENDMSG
00013Br 1  60                   RTS
00013Cr 1               ;-----------------------------------------------------------------------
00013Cr 1               TESTMSG2:
00013Cr 1  A9 07                LDA #7
00013Er 1  85 D7                STA NUMBYTES
000140r 1  A9 rr                LDA #<TESTDAT2
000142r 1  85 CE                STA DATAPTR
000144r 1  A9 rr                LDA #>TESTDAT2
000146r 1  85 CF                STA DATAPTR+1
000148r 1  20 rr rr             JSR SENDMSG
00014Br 1  60                   RTS
00014Cr 1               ;-----------------------------------------------------------------------
00014Cr 1               QUIET:
00014Cr 1  A9 90                LDA #$90
00014Er 1  85 D7                STA NUMBYTES
000150r 1  A9 rr                LDA #<QUIETMSG
000152r 1  85 CE                STA DATAPTR
000154r 1  A9 rr                LDA #>QUIETMSG
000156r 1  85 CF                STA DATAPTR+1
000158r 1  20 rr rr             JSR SENDMSG
00015Br 1  60                   RTS
00015Cr 1               ;-----------------------------------------------------------------------
00015Cr 1               CHGANNC:
00015Cr 1  AD rr rr             LDA ANNC2USE
00015Fr 1  29 03                AND #$03        ;KEEP ONLY 2 LEAST SIGNIFICANT BITS
000161r 1  0A                   ASL             ;MULTIPLY BY 2
000162r 1  48                   PHA             ;SAVE THIS VALUE FOR EACH MOD BEING DONE BELOW
000163r 1  18                   CLC
000164r 1  69 58                ADC #<AN0OFF    ;MODIFY LOW BYTE OF EACH ANNUNCIATOR ADDRESS IN CODE ABOVE
000166r 1  8D rr rr             STA MOD1+1
000169r 1               ;
000169r 1  68                   PLA             ;GET VALUE TO ADD
00016Ar 1  48                   PHA             ;SAVE IT AGAIN
00016Br 1  18                   CLC
00016Cr 1  69 58                ADC #<AN0OFF
00016Er 1  8D rr rr             STA MOD2+1
000171r 1               ;
000171r 1  68                   PLA             ;GET VALUE TO ADD
000172r 1  48                   PHA             ;SAVE IT AGAIN
000173r 1  18                   CLC
000174r 1  69 58                ADC #<AN0OFF
000176r 1  8D rr rr             STA MOD3+1
000179r 1                       ;
000179r 1  68                   PLA             ;GET VALUE TO ADD
00017Ar 1  48                   PHA             ;SAVE IT AGAIN
00017Br 1  18                   CLC
00017Cr 1  69 58                ADC #<AN0OFF
00017Er 1  8D rr rr             STA MOD4+1
000181r 1                       ;
000181r 1  68                   PLA             ;GET VALUE TO ADD
000182r 1  48                   PHA             ;SAVE IT AGAIN
000183r 1  18                   CLC
000184r 1  69 58                ADC #<AN0OFF
000186r 1  8D rr rr             STA MOD5+1
000189r 1                       ;
000189r 1  68                   PLA             ;GET VALUE TO ADD
00018Ar 1  48                   PHA             ;SAVE IT AGAIN
00018Br 1  18                   CLC
00018Cr 1  69 58                ADC #<AN0OFF
00018Er 1  8D rr rr             STA MOD6+1
000191r 1                       ;
000191r 1  68                   PLA             ;GET VALUE TO ADD
000192r 1  48                   PHA             ;SAVE IT AGAIN
000193r 1  18                   CLC
000194r 1  69 58                ADC #<AN0OFF
000196r 1  8D rr rr             STA MOD7+1
000199r 1                       ;
000199r 1  68                   PLA             ;GET VALUE TO ADD
00019Ar 1  48                   PHA             ;SAVE IT AGAIN
00019Br 1  18                   CLC
00019Cr 1  69 58                ADC #<AN0OFF
00019Er 1  8D rr rr             STA MOD8+1
0001A1r 1                       ;
0001A1r 1  68                   PLA             ;GET VALUE TO ADD
0001A2r 1  48                   PHA             ;SAVE IT AGAIN
0001A3r 1  18                   CLC
0001A4r 1  69 58                ADC #<AN0OFF    ;START BIT IS ALWAYS LOW
0001A6r 1  8D rr rr             STA MOD9+1
0001A9r 1                       ;
0001A9r 1  68                   PLA             ;GET VALUE TO ADD
0001AAr 1  48                   PHA             ;SAVE IT AGAIN
0001ABr 1  18                   CLC
0001ACr 1  69 59                ADC #<AN0ON     ;STOP BIT IS ALWAYS HIGH
0001AEr 1  8D rr rr             STA MOD10+1
0001B1r 1               ;
0001B1r 1  68                   PLA             ;GET VALUE TO ADD
0001B2r 1  18                   CLC
0001B3r 1  69 59                ADC #<AN0ON     ;INITIALIZE MIDI BY SENDING HIGH "CARRIER" BIT
0001B5r 1  8D rr rr             STA OK2INIT+1
0001B8r 1  4C rr rr             JMP INIT        ;TURN ON THE NEWLY SELECTED ANNUNCIATOR
0001BBr 1               ;-----------------------------------------------------------------------
0001BBr 1               TESTDAT1:
0001BBr 1  90 3C 40 40      .byte $90,$3C,$40,$40,$40,$43,$40
0001BFr 1  40 43 40     
0001C2r 1               TESTDAT2:
0001C2r 1  90 3C 00 40      .byte $90,$3C,$00,$40,$00,$43,$00
0001C6r 1  00 43 00     
0001C9r 1               QUIETMSG:
0001C9r 1  B0 78 00 B0      .byte $B0,$78,$00,$B0,$79,$00,$B0,$7B,$00
0001CDr 1  79 00 B0 7B  
0001D1r 1  00           
0001D2r 1  B1 78 00 B1      .byte $B1,$78,$00,$B1,$79,$00,$B1,$7B,$00
0001D6r 1  79 00 B1 7B  
0001DAr 1  00           
0001DBr 1  B2 78 00 B2      .byte $B2,$78,$00,$B2,$79,$00,$B2,$7B,$00
0001DFr 1  79 00 B2 7B  
0001E3r 1  00           
0001E4r 1  B3 78 00 B3      .byte $B3,$78,$00,$B3,$79,$00,$B3,$7B,$00
0001E8r 1  79 00 B3 7B  
0001ECr 1  00           
0001EDr 1  B4 78 00 B4      .byte $B4,$78,$00,$B4,$79,$00,$B4,$7B,$00
0001F1r 1  79 00 B4 7B  
0001F5r 1  00           
0001F6r 1  B5 78 00 B5      .byte $B5,$78,$00,$B5,$79,$00,$B5,$7B,$00
0001FAr 1  79 00 B5 7B  
0001FEr 1  00           
0001FFr 1  B6 78 00 B6      .byte $B6,$78,$00,$B6,$79,$00,$B6,$7B,$00
000203r 1  79 00 B6 7B  
000207r 1  00           
000208r 1  B7 78 00 B7      .byte $B7,$78,$00,$B7,$79,$00,$B7,$7B,$00
00020Cr 1  79 00 B7 7B  
000210r 1  00           
000211r 1  B8 78 00 B8      .byte $B8,$78,$00,$B8,$79,$00,$B8,$7B,$00
000215r 1  79 00 B8 7B  
000219r 1  00           
00021Ar 1  B9 78 00 B9      .byte $B9,$78,$00,$B9,$79,$00,$B9,$7B,$00
00021Er 1  79 00 B9 7B  
000222r 1  00           
000223r 1  BA 78 00 BA      .byte $BA,$78,$00,$BA,$79,$00,$BA,$7B,$00
000227r 1  79 00 BA 7B  
00022Br 1  00           
00022Cr 1  BB 78 00 BB      .byte $BB,$78,$00,$BB,$79,$00,$BB,$7B,$00
000230r 1  79 00 BB 7B  
000234r 1  00           
000235r 1  BC 78 00 BC      .byte $BC,$78,$00,$BC,$79,$00,$BC,$7B,$00
000239r 1  79 00 BC 7B  
00023Dr 1  00           
00023Er 1  BD 78 00 BD      .byte $BD,$78,$00,$BD,$79,$00,$BD,$7B,$00
000242r 1  79 00 BD 7B  
000246r 1  00           
000247r 1  BE 78 00 BE      .byte $BE,$78,$00,$BE,$79,$00,$BE,$7B,$00
00024Br 1  79 00 BE 7B  
00024Fr 1  00           
000250r 1  BF 78 00 BF      .byte $BF,$78,$00,$BF,$79,$00,$BF,$7B,$00
000254r 1  79 00 BF 7B  
000258r 1  00           
000259r 1               ;----------------
000259r 1               ; END OF PROGRAM
000259r 1               ;----------------
000259r 1               .endproc
000259r 1               
