             ;******* System Loader 
             ;Data must be in the following format:  
             ;Each hex number representing a byte must contain exactly two 
             ;characters. Each character must be in 0..9, A..F, or a..f and 
             ;must be followed by exactly one space. There must be no 
             ;leading spaces at the beginning of a line and no trailing 
             ;spaces at the end of a line. The last two characters in the 
             ;file must be lowercase zz, which is used as the terminating 
             ;sentinel by the loader. 
             ; 
FC57  C80000 loader:  LDX     0,i        ;X := 0 
FC5A  E9FC4F          STX     wordBuff,d ;Clear input buffer word 
             ; 
FC5D  49FC50 getChar: CHARI   byteBuff,d ;Get first hex character 
FC60  C1FC4F          LDA     wordBuff,d ;Put ASCII into low byte of A 
FC63  B0007A          CPA     'z',i      ;If end of file sentinel 'z' 
FC66  0AFC9A          BREQ    stopLoad   ;then exit loader routine 
FC69  B00039          CPA     '9',i      ;If characer <= '9', assume decimal 
FC6C  06FC72          BRLE    shift      ;and right nybble is correct digit 
FC6F  700009          ADDA    9,i        ;else convert nybble to correct digit
FC72  1C     shift:   ASLA               ;Shift left by four bits to send 
FC73  1C              ASLA               ;the digit to the most significant 
FC74  1C              ASLA               ;position in the byte 
FC75  1C              ASLA               
FC76  F1FC52          STBYTEA byteTemp,d ;Save the most significant nybble 
FC79  49FC50          CHARI   byteBuff,d ;Get second hex character 
FC7C  C1FC4F          LDA     wordBuff,d ;Put ASCII into low byte of A 
FC7F  B00039          CPA     '9',i      ;If characer <= '9', assume decimal 
FC82  06FC88          BRLE    combine    ;and right nybble is correct digit 
FC85  700009          ADDA    9,i        ;else convert nybble to correct digit
FC88  90000F combine: ANDA    0x000F,i   ;Mask out the left nybble 
FC8B  A1FC51          ORA     wordTemp,d ;Combine both hex digits in binary 
FC8E  F50000          STBYTEA 0,x        ;Store in Mem[X] 
FC91  780001          ADDX    1,i        ;X := X + 1 
FC94  49FC50          CHARI   byteBuff,d ;Skip blank or <LF> 
FC97  04FC5D          BR      getChar    ; 
             ; 
FC9A  00     stopLoad:STOP               ; 
