Original filename: BOOT2.M80 ;; Software for 8080A computer: boot ;; Copyright (C) 1980 by Robert Elton Maas ;ASCII character definitions SPACE =$20 ZERO =$30 ;Addresses of I/O devices CTL0 =$10 DATA0 =$11 CTL1 =$12 DATA1 =$13 ;Device-dependent data constants ACIARS=$17 ;Reset ACIAMD=$15 ;8 transparant data bits, one stop bit ;; -- BOOT 2 -- ;This program is a crude hexadecimal loader, including some I/O subroutines ; that will be used from later programs. This program is short enough ; that by using the BOOT1 program it can be entered from the keyboard ; in just a few minutes. Having done so, other programs may be ; entered using standard IBM-hexadecimal notation instead of the strange ; 3x+y notation used by BOOT1. ;To use this program, first deposit in locations 6 and 7 the address ; where loading is to start, then start this program. Type pairs of ; hexadecimal characters, the program will punctuate with spaces ; for your ease in verifying that you aren't out of sync. If you ; make a mistake, be sure you are in correct step where you would ; have been if you hadn't erred (make sure you haven't inserted or ; deleted a byte), and make a note of where the error occurred so ; you can fix it later. Continue with the rest of the data as if ; nothing had gone wrong. When you get to the end, stop the program ; and using the front panel go back and fix the bytes that are in error. .=$2028 BOOT2: LXI SP,$7FFF CALL INISIO LHLD 6 BOOT2A: CALL HEXIN MOV M,A MVI A,SPACE CALL OUTCHR INX H JMP BOOT2A ;Subroutine to initialize serial i/o ports INISIO: MVI A,ACIARS ;Reset OUT CTL0 OUT CTL1 MVI A,ACIAMD ;Normal mode OUT CTL0 OUT CTL1 RET ;Subroutine to read and echo one 7-bit character from port 0 RE7CHR: IN CTL0 RAR JNC RE7CHR IN DATA0 ANI $7F ;Fall into OUTCHR now... ;Subroutine to output one character from A to port 0 ;No registers are modified, not even PSW or A OUTCHR: PUSH PSW ;Save character OUTCH1: IN CTL0 ANI 2 JZ OUTCH1 POP PSW ;Restore character OUT DATA0 RET ;Subroutine to convert IBM-hexadecimal notation to a 4-bit number IBMVAL: CPI $41 JC IBMVA1 SUI 7 IBMVA1: SUI ZERO ;Blindly assumes it is in range RET ;Subroutine to accept and echo two characters from terminal, converting ; IBM hexadecimal notation to numeric values, and return one byte HEXIN: CALL RE7CHR CALL IBMVAL RLC RLC RLC RLC ANI $F0 ;Flush any shifted-in bits MOV D,A CALL RE7CHR CALL IBMVAL ADD D RET .END BOOT2