; *** BASIC KEY-IN BOOTSTRAP LOADER *** 
;
; THIS SIMPLE LOADER BOOTSTRAPS IN THE SECOND 
; LEVEL BOOTSTRAP, WHICH IN TURN LOADS THE 
; REAL PAPER TAPE LOADER. 
;
; TO USE THIS LOADER, PROCEED AS FOLLOWS: 
;       (1) KEY IN THIS LOADER, STARTING AT LOC 1000 
;       (2) MOUNT THE BOOTSTRAP TAPE, SO THAT 
;           THE BLOCK OF RUB0UTS AT THE BEGINNING 
;           OF THE TAPE IS IN THE READER 
;       (3) SET THE PROGRAMMED INPUT SWITCHES TO THE 
;           HIGH ORDER 8 BITS OF THE ADDRESS WHERE 
;           YOU WANT THE PAPER TAPE LOADER TO 
;           BE LOADED. (E.G. To CAUSE THE LOADER 
;           To BE LOADED AT 5C00, SET THE PROGRAMMED 
;           INPUT SWITCHES TO 5C.) 
;       (4) PRESS THE 'RESET' KEY, FOLLOWED BY THE 
;           'RUN' KEY, THEN MANUALLY START THE PAPER 
;           TAPE READER ON THE TELETYPE. 
;  IF EVERYTHING GOES CORRECTLY, THE LOADER WILL STOP 
;  THE PAPER TAPE READER, AND PRINT A * ON THE 
;  TELETYPE.  AT THIS POINT, MOUNT THE TAPE TO BE 
;  LOADED IN THE TELETYPE READER, THEN STRIKE ANY KEY 
;  ON THE TELETYPE.  THE LOADER WILL START THE 
;  PAPER TAPE READER, AND START LOADING THE TAPE. IF 
;  IT FINDS ANYTHING WRONG WITH THE TAPE, IT WILL 
;  STOP THE READER. LOADING MAY BE CONTINUED BY 
;  STRIKING A KEY ON THE TELETYPE. 
;
;
CNT     EQU     0F8H    ;SIZE OF 2ND LEVEL BOOTSTRAP 
BOOT1:  MVI     A,0CEH  ;GET MODE BYTE FOR SIO BOARD. 
        OUT     03      ;ISSUE IT 
        MVI     A,17H   ;GET COMMAND BYTE 
        OUT     03      ; ISSUE IT 
B1RST:  LXI     H,B1END ;GET LOAD ADDRESS 
        MVI     B,CNT   ;GET # OF BYTES 
;
LOOP:   IN      03      ;GET STATUS 
        ANI     2       ;IS THERE A BYTE READY 
        JZ      LOOP    ;KEEP WAITING 
        IN      2       ;GET THE BYTE 
        MOV     M,A     ;STORE IT 
        INR     A       ;WAS IT A RUBOUT? 
        JZ      B1RST   ;IF YES, RESET POINTERS 
        INX     H       ;ELSE, BUMP POINTER 
        DCR     B       ;AND DECR COUNT 
        JNZ     LOOP    ;IF NOT DONE, GO GET ANOTNER 
                        ; CHAR. ELSE, FALL THROUGH AND 
                        ; START UP SECOND LEVEL 
                        ; BOOTSTRAP. 
B1END   EQU     $ 
        END
