; READONLY - Copyright (c) 1985 by Paul R. Grupp base equ 0 ;base of cpm bios equ base bdos equ base+5 tpa equ base+100h cr equ 0dh lf equ 0ah org tpa call ilprt ;signon db cr,lf,'READONLY Vers 1.1 - ' db 'Copyright (c) 1985 by Paul R. Grupp',cr,lf,cr,lf,0 mvi c,12 ;bdos return version # call bdos mov a,h ora a ;check for mp/m jnz abort ;oops forgot about other user/jobs? mov a,l ani 0f0h ;strip minor vers # off cpi 20h ;must be 2.x jz ok abort: call ilprt ;print error message db 'Error: Can only patch CP/M version 2.x - Aborting.',cr,lf,0 ret ;return to cp/m ok: lhld bdos+1 ;hl point to address of bdos lxi d,7 dad d ;hl point to address of bdos r/o error vector mov e,m inx h mov d,m ;r/o entry address in de push d lhld bios+1 ;hl point to address of bios lxi d,40 dad d ;bios+40 point to write vector (past jmp) pop d ;get r/o address back mov m,e ;remove bios write and replace with r/o error inx h mov m,d call ilprt ;say what we did db 'DISK system set to Read/Only.',cr,lf,0 ret ;return to cp/m ilprt: ;print inline string starting after call ending with zero. xthl ;hl point to first character ilprt1: mov a,m ;get character inx h ora a jz ilprt2 ;done if zero push h ;bad bios trash this mov e,a mvi c,6 ;bdos direct i/o call bdos ;print character pop h jmp ilprt1 ;loop ilprt2: xthl ;end of string on stack ret end