; COMMAND.MAC v1.00 ; (c) 1984 ESKAY Software Service ; ; This command interpreter allows controlled use of the ; TurboDOS operating system. ; .z80 .request syslib ; cr equ 0dh lf equ 0ah ; tdos equ 50h ; ; SYSLIB externals ; extrn bdos extrn print extrn pstr extrn bbline extrn compb extrn cout extrn crlf extrn pafdc extrn f$open,f$read ; extrn getet ; start: ld sp,stack ;set up local stack ld c,17 ld e,0ffh ;enable autoload call tdos ld c,41 ld b,0 ld h,91h call 50h ld a,(80h) cp 9 jr nz,notsop xor a ld (restrc),a jr ..sop ; notsop: ld c,8 ;set abort address ld de,aba ;point to the nearest RET call tdos ;set it ld c,41 ld b,0 ld h,92h ld l,0 call tdos ..sop: ld a,(80h) add a,'0' ld (aclv##),a ld a,(0a0h) or a jr nz,loop ld hl,strted inc (hl) jr nz,loop call print cr,lf '[RTDS (c) ESKAY]',cr,lf '[COMMAND v1.30 - "HELP" for command list]',cr,lf,lf,0 ; ; loop back here for all kinds of things ; loop: call crlf ld c,105 ;time call ld de,datim call bdos ld a,'[' call cout ld a,(hrs) call putbcd ld a,':' call cout ld a,(min) call putbcd ld a,' ' call cout ld c,12 ;get slave id call 5 ld a,e add a,'@' call cout call print db ']',0 call getet ld c,32 ld e,0ffh ;get user call bdos ld b,a ld c,25 ;get drive call bdos ld c,a ; ; now display section name ; ld hl,table ;point to section table ..fsl: ld a,(hl) ;get drive cp c jr nz,..ndrv inc hl ld a,(hl) ;get user cp b jr nz,..nusr ..dl: inc hl ld a,(hl) cp ' '+1 jr c,..ctp call cout jr ..dl ; ..ndrv: inc hl ..nusr: ld de,9 add hl,de ld a,(hl) cp 1fh jr nz,..fsl ld a,b call pafdc ld a,c add a,'A' call cout ..ctp: ld a,'}' call cout ld a,1 ;capitalize call bbline ;get line ld (clen),a ld (cline),hl or a jp z,loop ld b,a ld a,(restrc) or a jr z,..skco ld a,3 cp b jr nc,..skco ld a,':' ccl: cp (hl) inc hl jp z,illu djnz ccl ..skco: db 3eh ;ld a,nn restrc: db 1 ;0=unrestricted or a call nz,chkres ;check restrict ld a,(clen) ld c,a ld b,0 ld hl,(cline) ld de,cmnd+1 ldir ld hl,cmnd ld (hl),'\' dec hl inc (hl) call crlf ex de,hl ld c,18 call tdos ld c,41 ;t-function get info ld b,0 ;from local slave only ld h,91h call tdos ld hl,cmnd+1 ;point to command line ld de,0a0h ;de is destination ld bc,32 ;up to 32 chars ldir ;move it ld c,32 ;get user number ld e,0ffh call bdos ld (87h),a ld c,25 ;get drive call bdos ld (88h),a ld de,89h ;store date/time ld c,105 call 5 ld (8dh),a ;seconds ld c,41 ;t-function set info ld b,0 ;local ld h,90h call tdos rst 0 ; ; chkres: ld hl,(cline) ld (pfcb),hl ld hl,tstfcb ld (pfcb+2),hl ld de,pfcb ld c,152 call bdos ld a,(tstfcb) or a jp nz,illu ld a,(tstfcb+15) inc a jr nz,ckc ld a,(tstfcb+13) cp 31 jp z,illu cp 4 jp c,illu ; ckc: ld hl,tstfcb+1 ld a,(hl) cp ' ' ret z ld b,8 ;compare 8 chars ld de,cdir call compb ret z ld de,ccht call compb ret z ld de,cchi call compb ret z ld de,csec call compb ret z ld de,cldi call compb ret z ld de,ccbb call compb ret z ld de,cxmo call compb ret z ld de,cwha call compb ret z ld de,ctyp call compb ret z ld de,cbye call compb ret z ld de,cocm call compb ret z ld de,cffi call compb ret z ld de,csdi call compb ret z ld de,cusr call compb ret z ld de,chel call compb jr z,help ld hl,(cline) call crlf call crlf call pstr call print db ' <-- Command not found',cr,lf,0 jp start aba: ret ; help: call print cr,lf,lf 'The following commands are available (standard RCPM-like):',cr,lf,lf 'BYE (log off)',cr,lf 'CBBS (message system)',cr,lf 'CHAT (talk to sysop)',cr,lf 'DIR (directory of current area)',cr,lf 'FILEFIND (search for file)',cr,lf 'HELP (this message)',cr,lf 'LDIR (library directory)',CR,LF 'SD (directory of current area)',cr,lf 'SECTION (change section)',cr,lf 'TURBO (enter special member section)',cr,lf 'TYPE (type file or LBR member)',cr,lf 'USRCFG (change password, logon area etc)',cr,lf 'WHATSNEW (show new files, current area)',cr,lf 'XMODEM (send or receive file)',cr,lf,lf 'Area changes made only through SECTION!',cr,lf,lf 'The prompt shows, left to right, current time, access level,',cr,lf 'elapsed time (H:MM) and current section.',cr,lf,lf,0 jp start ; illu: ld hl,(cline) call crlf call crlf call pstr call print db ' <-- Invalid Command',cr,lf,0 jp start ; putbcd: push af rra rra rra rra call pbcd pop af pbcd: and 0fh add a,'0' jp cout ; dseg ; table: 0,4,'KAYPRO ' 0,5,'NEWSTUFF' 0,6,'TURBODOS' 0,7,'16BIT ' 0,8,'UTILITY ' 0,9,'MISC ' 0,10,'NORSTAR ' 0,11,'TEXTUTL ' 0,12,'MODULES ' 0,13,'BDSC ' 0,14,'RCPM ' 0,15,'MODEM ' 0,16,'LANG ' 0,17,'HAM ' 0,18,'PASCAL ' 0,19,'FORTRAN ' 0,20,'OSBORNE ' 0,21,'HELP ' 0,22,'DIRS ' 0,23,'SQUSQ ' 0,24,'TALK ' 0,25,'DISKUTL ' 0,26,'BASIC ' 0,27,'ESKAY ' 0,28,'PICTURES' 0,29,'SIGM ' 0,30,'SYSLIB ' 1fh ; cdir: 'DIR ' ccht: 'CHAT ' cchi: 'CHATC ' cffi: 'FILEFIND' csec: 'SECTION ' cldi: 'LDIR ' ctyp: 'TYPE ' cxmo: 'XMODEM ' ccbb: 'CBBS ' cbye: 'BYE ' csdi: 'SD ' cwha: 'WHATSNEW' chel: 'HELP ' cusr: 'USRCFG ' cocm: 'TURBO ' ; strted: db 0ffh pfcb: ds 4 tstfcb: ds 36 syspw: db 'SYSPASSWORD',0,0,0,0,0,0,0,0,0,0,0,0,0 datim: dw 0 hrs: db 0 min: db 0 sec: db 0 cline: dw 0 clen: db 0 cmnd: ds 160 ds 80 stack equ $ end