Difference between revisions of "EZBOOTS.ASM"

From TheRetroWagon
Jump to: navigation, search
(Correcting comment typos)
Line 52: Line 52:
 
END DBASE
 
END DBASE
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
[[Category:Code]]

Revision as of 02:30, 3 August 2018

; JHA 7/29/2018
; ocr'ED an IMAGE of this, then cleaned it up a bunch
; from file IMSAI_CPM_System_Users_Guide_Version_1.31_Rev_2_Mar77.pdf

;EZEOOTS.ASM VERSION 1.0 10/27/75 JRB

;AUTOMATIC BOOTSTRAP SIMULATOR FOR STARTING CP/M
; IN SYSTEMS IN WHICH AUTOMATIC BOOTSTRAP DISK
; INTERFACE FIRMNARE HAS NOT YET BEEN INSTALLED.

;NOT NEEDED ONCE NEW PROM'S ARE INSTALLED IN FIF.

;THIS IS THE SHORT VERSION, SUITABLE FOR TOGGLINC IN.
;A SEPERATE VERSION, WITH ERROR RETRIES, IS
; RECOMMENDED IF YOU HAVE A WAY OP KEEPING IT RESIDENT.

BSBASE  EQU 4000H    ;YOU MAY CHANGE THIS TO ANY VALUE
                    ;GREATER THAT 7FH.IF BELOW 4000H
                    ;PROGRAM MUST BE RELOADED EACM
                    ;TIME YOU WANT TO BOOT CP/M.
EXIT    EQU O       ;WHERE TMIS PROGRAM EXITS TO
DISK    EQU 0FDH    ;FLOPPY DISK COMMAND OUTPUT PORT

        ORG BBASE           ;THIS IS ALSO START ADDRESS
;SET DISK INTERFACE STRING POINTER
        MVI A,10H   ;"SET STRING POINTER 0" COMMAND
        OUT DISK    ;SEND COMMAND TD DISK INTERFACE
        MVI A.BCMD AND 0FFH     ;LO ORDER OF STRING LOC
        OUT DISK    ;SEND TO DISK
        MVI A,BCMD SHR 8 AND 0FFM   ;HI ORDER HALF OF SAME
        OUT DISK
;READ SECTOR. ONE TRY ONLY.
        LXI H,BSTAT ;POINT AT STATUS BYTE OF STRING
        XRA A       ; SET ZERO IN A
        MOV M,A     ;ZERO STATUS BYTE
        ; N. B. A=0 IS ALSO Disk COMMAND TO DO STRING 0
        OUT DISK    ;DO IT!
WAIT:   ADD M       ;LOOK FOR NON-0 STATUS
        JZ  WAIT    ;KEEP LOOKING TILL IT COMES
;ALL THAT IS ABSOLUTELY ESSENTIAL AT THIS POINT IS TO JMP 0.
HANG:   CPI 1       ; THIS CODE CAUSES A HAND HERE IF
        JNZ HANG    ;..DISK READ FAILED.
        JMP EXIT    ;READ WAS ok, GO TO ROUTINE READ IN.
;PRE-INITIALIZED COMMAND STRING FOR DISK (MUST BE IN RAM)
BCMD:   DB  21H     ;CONMAND BYTE: READ, UNIT 1
BSTAT:  DB  0       ;STATUS BYTE, SET BY DISK WHEN DONE
        DW  0       :TRACK 0 (2 BYTES)
        DB  1       ;SECTOR 1
        DW  0       ;BBUFFER ADDRESS: READ TO LOCATION 0

END DBASE