; ; usage: SETFLAGS [ON|OFF] [flagbitid] ; ; DOS+ utility. For run-time configuration of DOS+. ; Any reboot restores the defaults after this is run. ; taccbit equ 010h; controls access time stamping dciobk equ 020h; controls breaks on BDOS call #6 brkbit equ 040h; controls all breaks @flags equ 018h; BDOS offset to flags byte, base page ; ; DOS+/CPM calls tstr equ 9 cpmver equ 12 getinfo equ 210; e = 0 returns BDOS base address ; bdos equ 5 fcb equ 05ch altfcb equ 06ch defdma equ 080h ; cr equ 0dh lf equ 0ah ; jmp bgn ; ; This message also defines the acceptable words. ']' terminates lists. hlpmsg: db 'usage: SETFLAGS' onoff: DB ' [ OFF | ON ]' flags: DB ' [ BREAK | DCIOBRK | TACCESS | COMPAT ]', cr,lf db ' dis/enable access time file stamps/breaks' db '/compatiblity mode for DOS+',cr,lf db 'ex: SETFLAGS on taccess$' ; badver: db 'Needs DOS+ 2.4 up$' ; ; Start here bgn: lxi h,0 dad sp lxi sp,stack push h lda defdma ora a jz help; empty command line, help mvi c,cpmver; Make sure running DOS+ 2.4 up call bdos lxi d,badver inr h dcr h jnz msgxit; not MPM etc cpi 22h jc msgxit; < 2.2, cant be compatible mode cpi 30h jnc msgxit; Can't use CPM 3 cpi 24h jnc bgn2; ok, 2.4 thru 2.f call getbas; of DOS+, if running mov a,h; DOS+ returns base pointer ora a; CPM returns 0 jz msgxit; not in compatible mode ; " " ; DOS+ running, check parameters and execute bgn2: lxi h,onoff lxi d,fcb+1 call which; scan 1st parameter jnz help mov a,c; on returns 20h, off 40h sui 40h; carry for on sbb a; 0 for off, 0ffh for on mov b,a; save flag lxi h,flags lxi d,altfcb+1; 2nd parameter call which; select the particular flag in c jnz help; not found bgn3: call getbas mvi l,@flags; offset to flag byte mov a,b cma ana c mov b,a; bit select, 0 or bit mov a,m ora c; set bit xra b; then set/reset it mov m,a ; " " ; restore sp and exit exit: pop h sphl ret ; ; Help message and exit help: lxi d,hlpmsg ; " " ; Message de^ to console msgxit: mvi c,tstr call bdos jmp exit ; ; Get BDOS base page, on DOS+. CPM returns 0 ; a,f,h,l getbas: push b push d mvi c,getinfo mvi e,0 call bdos; get BDOS base page pop d pop b ret ; ; select the flag. z flag if ok. Result in c ; DE points to string to check, HL to reference, ']' terminated. ; (reference string starts with blank, non-blk, blk, then string) ; 1st in list return 40h, then 20h, etc. 8th returns 80h. which: mvi c,80h; break left shifted push d wh1: pop d wh2: mov a,m cpi ' ' inx h jnz wh2; skip to a blank wh3: mov a,m cpi ' ' inx h jz wh3; skip to non-blank cpi ']'; test for done jz wh6; done, not found mov a,c; now hl points past non-blank rrc mov c,a; r shift bit push d; save input id wh4: inx h; advance to 1st ref. char ldax d inx d cmp m jnz wh1; not this, try next sui ' '; legals are blank terminated jnz wh4; test next char pop d; a = 0 here wh6: ora a; set flags ret ds 48 stack: end