Downloader Compainion 6808 Code

================================================================
; Author: Jorge Codina 10 November 1994
;
;   hcode7.txt
;   this is the machine code for the HERO I Parallel loader
;   It loads one byte at a time from the input port on the Expansion
board 
;
;   Enter via Hex KeyPad and save to cassette
;
;   TempByte    0047
;   Counter     0048
;   StartAddr   0049, 004A
;   EndCounter  004B
;
;   END OF FILE == S9 (53 39)
;   S0 == 53 30 ; not used in this version
;   S1 == 53 31 ; not used in this version
;
;   Lots of free space left for corrections, filled with 00
;
;
; Interupt Routine
;
0050    B6 C2 A0    ;LDAA (extend) (expansion board input buffer)
        97 47       ;STAA TempByte
0055    39          ;RTS return from subroutine 
                    ;Recommended over RTI by HERO manual
;
0056    00 00 00
        00 00 00
005D    00 00 00
;
;
; Start Program
;
0060    83          ;Put Robot into Machine Language Mode (faster)
        86 7E       ;LDA (immed) copy '7e' (JMP) to AccA
        97 2D       ;STAA (direct) copy AccA to 002d, 
                    ;Expansion board interupt vector
        86 00       ;Interupt routine stored at 0050
        97 2E   
        86 50
        97 2F
        86 02       ;LDA (immed) 2
006F    97 48       ;initialized Counter to 2 (# of address bytes
needed)
        86 00       ;LDA (immed) 0
        97 4B       ;initialized EndCounter to zero
0075    7E 00 80    ;JMP to 0080
;
0078    00 00 00
        00 00 00
007E    00 00
;
;
; Loop
;
0080    7F C2 00    ;CLR (extend) IRQ status byte
        86 80       ;LDAA (immed)
        B7 C2 00    ;re-enable Exp board IRQ, leave rest disabled
        ;   
0088    0E          ;CLI enable interupts
        3E          ;WAI wait for interupt
        ;
008A    96 48       ;LDAA (direct) Counter
008C    2E 22       ;BGT (> 0) Starting Address not yet set
                    ;go to setStartAddr at 00B0
        ;
008E    96 47       ;LDAA (direct) TempByte 
        A7 00       ;STAA (index, no offset) to program address
        08          ;INX increment Index Register
        ;
0093    81 53       ;Is the Char in AccA an "S" (hex 53)
0095    27 39       ;BEQ (= 0) go to sFound at 00D0
        ;
0097    96 4B       ;LDDA (direct) EndCounter
                    ;if > 0 then EOF processing active
0099    2E 45       ;BGT go to eofProcessing at 00E0
        ;
009B    7E 00 80    ;JMP to 0080 (loop)
;
009E    00 00 00
00A1    00 00 00
        00 00 00
        00 00 00
        00 00 00
00AD    00 00 00
;
; setStartAddr
;
00B0    86 02       ;LDA (immed) 2
        91 48       ;CMPA (direct) with Counter
00B4    26 0B       ;BNE (Not equal) go to second byte processing
                    ;at 00C1
;
00B6    96 47       ;LDAA (direct) TempByte 
        97 49       ;STAA (direct) the first byte in 0049
        86 01       ;
        97 48       ;Set Counter to 1
00BE    7E 00 80    ;JMP to 0080 (loop)
;
00C1    96 47       ;LDAA (direct) TempByte 
        97 4A       ;STAA (direct) the second byte in 004A
        DE 49       ;LDX (direct), copy the starting address to the
                    ;Index Register
        86 00
        97 48       ;Set Counter to zero
00CB    7E 00 80    ;JMP to 0080 (loop)
;
00CE    00 00

;
; sFound
;
00D0    86 01
        97 4B       ;Set EndCounter to 1
00D4    7E 00 80    ;JMP to 0080 (loop)
;
00D7    00 00 00
        00 00 00
00DD    00 00 00
;
;
; eofProcessing
; Sequence is:
;   Byte 0 = 53 (S)
;   Byte 1 = 39 (9)
;
00E0    96 47       ;LDAA (direct) TempByte 
        81 39       ;Is the Char in AccA a "9" (hex 39)
00E4    27 0A       ;BEQ go to endProgram at 00F0
;
00E6    7F 00 4B    ;CLR EndCounter
00E9    7E 00 80    ;JMP to 0080 (loop)
;
00EC    00 00 00
00EF    00
;
;
; endProgram
;
00F0    3F          ;Robot Language
00F1    3A          ;Return to Executive Mode (end program)
;
; End of Program
;
================================================================
;
;sample load file.
;
02 00       ;starting address
00 01 02    ;Data values
03 04 05    ;semi colon is comment
06 07 08
09 0A 0B
0C 0D 0E
0F
S9      ;S9 end sequence
;
================================================================
END