; OSBORNE EXECUTIVE - Screen Dump Utility ; ; - written Dec'84 by Mark Steinbrecher ; (with help from Dave Mabry) ; ; This program is the associated COM file that loads a screen ; dump utility RSX for the Osborne Executive. ; ; It is assembled and linked as so: ; ; MAC DUMPCOM ; HEXCOM DUMPCOM ; RMAC DUMPRSX ; LINK DUMPRSX [OP] ; REN DUMPRSX.RSX=DUMPRSX.PRL ; GENCOM DUMPCOM DUMPRSX ; ; It is invoked thusly: ; ; SDUMP <^A> ; ; Where A can be any alpha and designates the "trigger" character. ; The trigger character will be the control-alpha combination ; requested. If no command tail is present, the program will ; default to ^@ and print a message to that effect. ; ; To remove screen dump utility from memory .... ; ; SDUMP REMOVE ; ; when at operating system level. ; bdos equ 5 ;BDOS entry buf equ 80h ;Command tail buffer vers equ 11 ;Version number rsx equ 60 ;BDOS RSX function call vn equ 12 ;BDOS version function call pstr equ 9 ;BDOS print string call cr equ 0dh ;ASCII carriage return lf equ 0ah ;ASCII line feed org 100h lxi sp,stack ;Good practice mvi c,pstr ;Signon with version number lxi d,signon call bdos mvi c,vn ;Make sure we are running call bdos ;under CP/M Plus or later mov a,h ora a ;First check for CP/M jnz error mov a,l cpi 31h ;Now make sure version 3.1 or later jc error ; Parse the command line to see if trigger character is other than default lxi h,buf ;Point to command tail buffer mov a,m ;Get character count ora a ;Were there any characters in it ? jz default ;No, take default inx h ;Yes, point to first character call skip ;Skip any spaces that might exist mov a,m ;Get first non-space call ucase ;CCP should do it, but who knows ? cpi 'R' ;Is user asking for removal ? jz remove ;Yes, go do it cpi '^' ;Is it valid ? jnz syntax ;No, give him some help inx h ;point to alpha mov a,m ;Get the character call ucase cpi '@' ;Only allow from '@' to '_' for jc syntax ; control characters cpi '_'+1 jnc syntax ; At this point the command tail has been verified for correct character ; after the '^'. Any characters after that are ignored. sta trgch ;Store in message sui 40h ;Make a "control" character sta trigger ;Pass to the RSX in param1 default: mvi c,rsx lxi d,rsxpb call bdos ;Call RSX to initialize itself ora a ;Zero returned indicates success lxi d,lodmsg jz good lxi d,nolod good: mvi c,pstr call bdos ;Inform user of success jmp exit remove: mvi a,0ffh ;Flag in rsxpb for removal sta param1 mvi c,rsx lxi d,rsxpb call bdos ;Call RSX and ask for removal ora a ;Check return code, 0==> success lxi d,rmsg ;Removed message jz good lxi d,nolod ;Error message jmp good skip: ;Skip over spaces, leaving HL pointing to first non-space mov a,m ;Get next character cpi ' ' ;Is it a space ? rnz ;If not, then done inx h ;Else, do next character jmp skip ucase: ;Force a lowercase alpha in A to be uppercase cpi 'a' ;Check for between 'a' and 'z' rc cpi 'z'+1 rnc ani 5fh ;It is, therefore force uppercase ret syntax: lxi d,synmsg ;Display help message jmp error1 error: lxi d,errmsg error1: mvi c,pstr ;Display error message and exit call bdos mvi a,0ffh ;Must tell RSX to remove itself sta param1 ; since there was an error mvi c,rsx lxi d,rsxpb call bdos exit: mvi c,0 ;Warm Boot call bdos signon: db 'SDUMP V' db (vers/10 + '0'),'.',(vers MOD 10) + '0' db ' for Osborne Executive' db cr,lf,'$' synmsg: db 'Huh ?',cr,lf db 'Correct syntax: SDUMP <^(char)>',cr,lf db ' Where (char) is A-Z, a-z, @, [, \, ], ^, or _',cr,lf db 'Examples: SDUMP ^G <-- sets cntl-G as trigger',cr,lf db ' sdump ^k <-- sets cntl-K as trigger',cr,lf db ' sdump <-- sets cntl-@ as trigger (default)',cr,lf db ' sdump remove <-- removes RSX from memory ' db '$' errmsg: db 'This program requires CP/M 3 or later. ','$' lodmsg: db 'Screen dump function loaded.',cr,lf db 'Press ^' trgch: db '@ to dump screen to list device. ','$' nolod: db 'ERROR: Print screen RSX not loaded. ','$' rmsg: db 'Print screen RSX removed. ','$' rsxpb: db 53 ;Arbitrary function number for RSX db 1 ;Number if parameters following param1: db 0 ;Indicates initialize RSX trigger: db 0 ;Trigger character, default ^@ ds 10 stack: end