; User control of write protection. BYERSX Auxiliary ; Normally passworded program. ; bdos equ 5 fcb equ 05ch cr equ 0dh lf equ 0ah ; aseg org 0100h ; lxi h,0 dad sp lxi sp,stack push h mvi c,87 lxi d,0 call bdos ora a lxi d,norsx jz exit lxi h,fcb+1 mov a,m cpi 'O' inx h mov a,m jnz help inx h cpi 'F' jz off cpi 'N' jz on ; " " ; give help help: lxi d,hlpmsg ; " " ; message and exit exit: mvi c,9 call bdos pop h sphl ret ; ; remove write protection off: mov a,m cpi 'F' jnz help inx h mov a,m cpi ' ' jnz help lda fcb ora a lxi d,0 jz off1; disable all protection cpi 16+1 jnc help call qdrv mov a,h cma ana d mov d,a mov a,l cma ana e mov e,a off1: mvi c,91 call bdos lxi d,done jmp exit ; ; write protect one or all drives on: mov a,m cpi ' ' jnz help lda fcb ora a lxi d,0ffffh jz on1; protect all drives cpi 16+1 jnc help call qdrv mov a,d ora h mov d,a mov a,e ora l mov e,a on1: mvi c,91 call bdos lxi d,done jmp exit ; ; Identify the selected drive (a) in hl, ; and the existing wrtprotect vector in de. ; a,f,b,c,d,e,h,l qdrv: push psw mvi c,87; master RSX call mvi e,20; for preset w/prot vector call bdos xchg; to de pop psw lxi h,1 qdrv1: dcr a rz dad h; shift bit into position jmp qdrv1 ; hlpmsg: db 'usage: WPROTECT [d:][ON|OFF] (controls write protection)' db cr,lf,' Omitting "d:" un/protects all drives, otherwise only' db cr,lf,' the specified drive''s protection is altered.' db cr,lf,' Protection is only effective in remote mode$' norsx: db 'BYERSX not running$' done: db 'Done$' ; state: ds 1; BYERSX input state ; ds 48 stack: ds 0 ; end