title 'ENQUIRE RSX residency (85/09/24)' ; ; Usage: ENQURE nn (where nn is RSX number. prints response in a) ; quicky test mechanism for RSX's. Can be very DANGEROUS. ; Ex: "ENQUIRE 1" will show hex value of next key struck. ; "ENQUIRE 64 FFFF" will inactivate RSX #100 ; "ENQUIRE 63" will show if RSX #99 is presently active ; "ENQUIRE C" will show CPM version number. ; "ENQUIRE 2 45" will print hex 45, i.e "E" ; ; 1.2 (85/11/09) Converted to Intel mnenonics. Corrected error ; detection in getnum. Added version display. ; 1.1 (85/09/24) Corrected for return value with lo byte zero ; 1.0 (85/01/26) By C.B. Falconer ; bdos equ 5 cout equ 2 pstrg equ 9 fcb1 equ 05ch; find rsx # here fcb2 equ 06ch; find argument here, if any ver equ 12 ; cr equ 13 lf equ 10 ; lxi h,0 dad sp lxi sp,stack push h lxi h,fcb1 call getnum jc help; invalid enquiry mov c,e lxi h,fcb2 call getnum; ignore failure, use default call bdos ora a jnz live inr h dcr h jnz live lxi d,none exitm: call tstr exit: pop h sphl ret ; hlpmsg: db 'Usage: ENQUIRE nn [arg]; Ver. ' db ver / 10 + '0', '.', ver MOD 10 + '0', cr,lf db ' nn is bdos call #, values in hex',cr,lf db ' DANGEROUS - can execute any BDOS function$' none: db 'No such RSX now active (or function returns 0)$' ; help: lxi d,hlpmsg jmp exitm ; ; output string de tstr: mvi c,pstrg jmp bdos ; ; getnumber from hl^ up. 1st byte should be zero. Carry if invalid ; or initial space. getnum: lxi d,0 mov a,m inx h ora a stc rnz mov a,m call qhex rc; no 1st digit ani 0fh mov e,a gnum1: inx h mov a,m call qhex jc gnumx ani 0fh xchg dad h dad h dad h dad h add l mov l,a xchg jmp gnum1 gnumx: cpi ' ' rz stc ret ; ; carry for non-hex char, else correct A thru F qhex cpi '0' rc cpi 'F'+1 cmc rc cpi '9'+1 cmc rnc; '0'..'9' cpi 'A' rc; '9'+1 thru 'A'-1 sui 7; convert ret ; livmsg: db cr,lf,'live RSX, response(a, hl)=$' ; live: push psw push h lxi d,livmsg call tstr pop h pop psw call t2hx mvi a,' ' call couta call t4hx jmp exit ; t4hx: mov a,h call t2hx mov a,l ; " " t2hx: push psw rrc rrc rrc rrc ani 0fh call t1hx pop psw ; " " t1hx: ani 0fh adi 090h daa aci 040h daa ; " " couta: push b push d push h mov e,a mvi c,cout call bdos pop h pop d pop b ret ; ds 32 stack: ds 0 ; end