Runs IMSAI's SCS-1 monitor and assembler, from a tape dump, under CP/M.
Written by Sarah Craswell while writing and debugging Zimul80r
SCS-1, IMSAI's Self-Contained System, is a monitor, line editor, 8080 assembler, memory file manager and breakpoint debugger that runs at 0050H with its console on an 8251. The loader copies it down to 0050H and sends its console through the CP/M BIOS, so it uses whatever console CP/M has. EXEC 0000 returns to CP/M.
make.py builds the .COM from a dump of the tape in Intel HEX. The SCS-1 program itself is IMSAI's software and isn't included.
; SCS1.ASM - runs IMSAI's SCS-1 monitor and assembler, from a tape dump, under CP/M 2.2;; SCS-1 (the IMSAI Self-Contained System: monitor, line editor, 8080 assembler, memory file; manager and breakpoint debugger) runs at 0050H and talks to an 8251 at ports 02H and 03H.; This loader copies it to 0050H and sends its console through the CP/M BIOS instead, so it; uses whatever console CP/M has: the Disk Jockey's, or the MIO's after MIO.COM.; make.py fills IMAGE with the program from the tape's Intel HEX.;; SCS-1 keeps its workspace at 1000H-1123H and puts its RST 1 breakpoint jump at 0008H, so; CP/M's jumps at 0000H and 0005H survive and EXEC 0000 returns to CP/M by a warm boot.LOADAT EQU 0050H ; where SCS-1 runs (its cold start)IMGLEN EQU 0DFAH ; 0050H-0E49HINIT EQU 0080H ; programs the 8251INITEND EQU 0090H ; the first instruction after thatCIN EQU 0129H ; reads a character into A and BCOUT EQU 0136H ; writes the character in BSHIMS EQU 0010H ; RST 2-6 vectors, which neither CP/M nor SCS-1 uses ORG 100H JMP MOVEIMAGE: DS IMGLEN; Copy SCS-1 down to 0050H. Copying upwards is safe: the destination is always below the; source, and this code is above the end of the destination.MOVE: LXI H,IMAGE LXI D,LOADAT LXI B,IMGLENMOVE1: MOV A,M STAX D INX H INX D DCX B MOV A,B ORA C JNZ MOVE1; The console routines go to 0010H, with the BIOS's CONIN and CONOUT filled in. LXI H,CONS LXI D,SHIMS MVI B,CONSLENMOVE2: MOV A,M STAX D INX H INX D DCR B JNZ MOVE2 LHLD 1 ; the BIOS's warm boot entry, BIOS+3 LXI D,6 DAD D ; CONIN is BIOS+9 SHLD CIBIOS+1 INX H INX H INX H ; CONOUT is BIOS+0CH SHLD COBIOS+1; Patch SCS-1: skip the 8251 set-up, and send its two console routines to these. MVI A,0C3H ; JMP STA INIT STA CIN STA COUT LXI H,INITEND SHLD INIT+1 LXI H,CI SHLD CIN+1 LXI H,CO SHLD COUT+1 JMP LOADATCONS: .PHASE SHIMS; As SCS-1's own input routine: the character in A and B, bit 7 off. Other registers are kept.CI: PUSH H PUSH D PUSH BCIBIOS: CALL 0 POP B POP D POP H ANI 7FH MOV B,A RET; As SCS-1's own output routine: sends B and returns with it in A, flags NZ and NC.CO: PUSH H PUSH D PUSH B MOV C,BCOBIOS: CALL 0 POP B POP D POP H MVI A,1 ORA A MOV A,B RET .DEPHASECONSLEN EQU $-CONS END