mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-26 09:54:20 +00:00
Upload
Digital Research
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Assign Console Control Block
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
acb_cns equ byte ptr 0
|
||||
acb_match equ byte ptr acb_cns + byte
|
||||
acb_pd equ word ptr acb_match + byte
|
||||
acb_name equ byte ptr acb_pd + word
|
||||
acblen equ acb_name + pnamsiz
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
;*************************************************************
|
||||
;*
|
||||
;* Abort Parameter Block
|
||||
;*
|
||||
;*************************************************************
|
||||
|
||||
apb_pd equ word ptr 0
|
||||
apb_term equ word ptr apb_pd + word
|
||||
apb_cns equ byte ptr apb_term + word
|
||||
apb_net equ byte ptr apb_cns + byte
|
||||
apb_pdname equ byte ptr apb_net + byte
|
||||
apb_len equ apb_pdname + pnamsiz
|
||||
|
||||
; Priority processes are set to when aborting
|
||||
|
||||
abt_prior equ 32
|
||||
@@ -0,0 +1,637 @@
|
||||
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* BDOS interface
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
BMPM equ true
|
||||
BCPM equ false
|
||||
|
||||
CSEG
|
||||
|
||||
if PCMODE
|
||||
EXTRN bdosrw:NEAR
|
||||
EXTRN compfs:NEAR
|
||||
EXTRN closef:NEAR
|
||||
EXTRN deletef:NEAR
|
||||
EXTRN getspace:NEAR
|
||||
EXTRN makef:NEAR
|
||||
EXTRN openf:NEAR
|
||||
EXTRN chk_pcfcb:NEAR
|
||||
EXTRN pc_chkrec:NEAR
|
||||
EXTRN pcsearch:NEAR
|
||||
EXTRN renamef:NEAR
|
||||
EXTRN setattsf:NEAR
|
||||
EXTRN setstamp:NEAR
|
||||
EXTRN truncatef:NEAR
|
||||
EXTRN xfcb:NEAR
|
||||
|
||||
PUBLIC check_fcb1
|
||||
PUBLIC check_fcb3
|
||||
PUBLIC checkwrite
|
||||
PUBLIC chk_olist
|
||||
PUBLIC chk_wild
|
||||
PUBLIC chk_wild0
|
||||
PUBLIC ckrofile
|
||||
PUBLIC close021
|
||||
PUBLIC conv_rr
|
||||
PUBLIC copy_user_no
|
||||
PUBLIC dblockio
|
||||
PUBLIC directio
|
||||
PUBLIC discard_data
|
||||
PUBLIC flush
|
||||
PUBLIC flushx
|
||||
PUBLIC fxi40
|
||||
PUBLIC get_atts
|
||||
PUBLIC init_wzf
|
||||
PUBLIC lret_eq_ff
|
||||
PUBLIC openx1a
|
||||
PUBLIC pack_sdcnt
|
||||
PUBLIC pc_make_test
|
||||
PUBLIC rd_pcdir
|
||||
PUBLIC reset_checksum_fcb
|
||||
PUBLIC roferror
|
||||
PUBLIC search_olist
|
||||
PUBLIC seek;
|
||||
PUBLIC setcdr
|
||||
PUBLIC setenddir
|
||||
PUBLIC set_aret
|
||||
PUBLIC set_lret1
|
||||
PUBLIC test_lock
|
||||
PUBLIC tst_olist
|
||||
PUBLIC update_fat
|
||||
PUBLIC wrbuff;
|
||||
PUBLIC wrdir
|
||||
endif
|
||||
|
||||
org 0000h
|
||||
|
||||
jmp init ;bdos initialization
|
||||
jmp entry ;inter module entry pt.
|
||||
|
||||
sysdat dw 0 ;seg address of sysdat
|
||||
supervisor rw 2 ;supervisor offset and segment
|
||||
|
||||
dev_ver dw 6 ; chk'd by GENSYS
|
||||
|
||||
db 'COPYRIGHT(C)1983,84,'
|
||||
db 'DIGITAL RESEARCH(02/07/84)'
|
||||
db 'XXXX-0000-654321'
|
||||
|
||||
;====
|
||||
init: ; initialize bdos/xios modules
|
||||
;====
|
||||
; entry: DS = system data area
|
||||
|
||||
; code segment values setup by gensys
|
||||
; mov sysdat,ds
|
||||
; mov ax,supmod
|
||||
; mov cs:supervisor,ax
|
||||
; mov ax,supmod+2
|
||||
; mov cs:supervisor+2,ax
|
||||
|
||||
retf
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* bdos function table
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
; structure of entry in functab
|
||||
|
||||
btab_addr equ word ptr 0
|
||||
btab_flag equ byte ptr (btab_addr + word)
|
||||
|
||||
bf_getmx equ 00001b ;get mxdisk queue
|
||||
bf_cshell equ 00010b ;conditional shell function
|
||||
bf_fcb33 equ 00100b ;33 byte fcb flag
|
||||
bf_fcb36 equ 01000b ;36 byte fcb flag
|
||||
bf_resel equ 10000b ;disk reselect flag
|
||||
|
||||
; bdos function table
|
||||
|
||||
functab dw func13 ! db 00001b ; fxi13 equ 00h ;disk reset
|
||||
dw func14 ! db 00001b ; fxi14 equ 01h ;select disk
|
||||
dw func15 ! db 10101b ! fxi15 equ 02h ;open file
|
||||
ftab16 dw func16 ! db 10101b ! fxi16 equ 03h ;close file
|
||||
dw func17 ! db 00101b ! fxi17 equ 04h ;search first
|
||||
dw func18 ! db 00001b ! fxi18 equ 05h ;search next
|
||||
dw func19 ! db 10101b ! fxi19 equ 06h ;delete file
|
||||
dw func20 ! db 10111b ! fxi20 equ 07h ;read sequential
|
||||
dw func21 ! db 10111b ! fxi21 equ 08h ;write sequential
|
||||
dw func22 ! db 00101b ! fxi22 equ 09h ;make file
|
||||
dw func23 ! db 10101b ! fxi23 equ 0Ah ;rename file
|
||||
dw func24 ! db 00000b ; fxi24 equ 0Bh ;return login vector
|
||||
dw func25 ! db 00000b ; fxi25 equ 0Ch ;return current disk
|
||||
dw func26 ! db 00000b ; fxi26 equ 0Dh ;set dma address
|
||||
dw func27 ! db 00001b ! fxi27 equ 0Eh ;get alloc addr
|
||||
dw func28 ! db 00001b ; fxi28 equ 0Fh ;write protect disk
|
||||
dw func29 ! db 00000b ; fxi29 equ 10h ;get r/o vector
|
||||
dw func30 ! db 00101b ! fxi30 equ 11h ;set file attributes
|
||||
dw func31 ! db 00001b ! fxi31 equ 12h ;get disk parm addr
|
||||
dw func32 ! db 00000b ; fxi32 equ 13h ;set/get user code
|
||||
dw func33 ! db 11011b ! fxi33 equ 14h ;read random
|
||||
dw func34 ! db 11011b ! fxi34 equ 15h ;write random
|
||||
dw func35 ! db 11001b ! fxi35 equ 16h ;compute file size
|
||||
dw func36 ! db 01001b ; fxi36 equ 17h ;set random record
|
||||
dw func37 ! db 00001b ; fxi37 equ 18h ;reset drive
|
||||
dw func38 ! db 00001b ; fxi38 equ 19h ;access drive
|
||||
dw func39 ! db 00001b ! fxi39 equ 1Ah ;free drive
|
||||
dw func40 ! db 11011b ! fxi40 equ 1Bh ;write random w/zero fill
|
||||
dw func42 ! db 11001b ! fxi42 equ 1Ch ;lock record
|
||||
dw func43 ! db 11001b ! fxi43 equ 1Dh ;unlock record
|
||||
dw func44 ! db 00000b ; fxi44 equ 1Eh ;set multi-sector count
|
||||
dw func45 ! db 00000b ; fxi45 equ 1Fh ;set bdos error mode
|
||||
dw func46 ! db 00001b ; fxi46 equ 20h ;get disk free space
|
||||
dw func48 ! db 00001b ! fxi48 equ 21h ;flush buffers
|
||||
dw func51 ! db 00000b ; fxi51 equ 22h ;set dma base
|
||||
dw func52 ! db 00000b ; fxi52 equ 23h ;get dma base
|
||||
dw func98 ! db 00001b ! fxi98 equ 24h ;reset alloc vector
|
||||
dw func99 ! db 01001b ! fxi99 equ 25h ;truncate file
|
||||
dw func100 ! db 00101b ! fxi100 equ 26h ;set directory label
|
||||
dw func101 ! db 00001b ; fxi101 equ 27h ;return directory label data
|
||||
dw func102 ! db 00101b ! fxi102 equ 28h ;read file xfcb
|
||||
dw func103 ! db 00101b ! fxi103 equ 29h ;write or update file xfcb
|
||||
dw func104 ! db 00000b ; fxi104 equ 2Ah ;set current date and time
|
||||
dw func105 ! db 00000b ; fxi105 equ 2Bh ;get current date and time
|
||||
dw func106 ! db 00001b ; fxi106 equ 2Ch ;set default password
|
||||
dw func116 ! db 10101b ; fxi113 equ 2Dh ;set file date and time
|
||||
dw pr_term ! db 00001b ! fxi143 equ 2Eh ;terminate process
|
||||
dw funcdio ! db 00001b ; fxi??? equ 2Fh ;direct disk I/O
|
||||
|
||||
;=====
|
||||
entry: ; bdos module entry point
|
||||
;=====
|
||||
; entry: CL = internal bdos function number
|
||||
; DX = argument
|
||||
; DS = system data area
|
||||
; ES = user data area
|
||||
; exit: AX = BX = return code
|
||||
|
||||
xor ch,ch! mov si,cx
|
||||
shl si,1! add si,cx ; multiply by 3
|
||||
add si,offset functab
|
||||
test cs:btab_flag[si],bf_getmx
|
||||
jz nomx
|
||||
call getdiskmx
|
||||
jmps exit
|
||||
nomx:
|
||||
xor bx,bx ;initialize return parameter
|
||||
call cs:btab_addr[si]
|
||||
exit:
|
||||
mov ax,bx
|
||||
retf
|
||||
|
||||
restart: ;restart entry point for media changes
|
||||
;-------
|
||||
mov cl,fx_intrn ;CX = internal function #
|
||||
xor ch,ch ;SI = offset of BDOS functab entry
|
||||
mov si,cx
|
||||
shl si,1
|
||||
add si,cx
|
||||
add si,offset functab
|
||||
mov bx,rlr ;BX = PD addr
|
||||
mov dx,info ;DX = argument addr
|
||||
mov es,uda_save ;ES = UDA addr
|
||||
cli
|
||||
jmps setup_stack
|
||||
|
||||
getdiskmx:
|
||||
;---------
|
||||
; entry: SI = offset of bdos functab entry
|
||||
; CX = internal bdos function number
|
||||
; DX = argument
|
||||
|
||||
mov bx,rlr
|
||||
mov ax,p_flag[bx] ! and ax,pf_tempkeep
|
||||
push ax ;save tempkeep flag
|
||||
or p_flag[bx],pf_tempkeep ;do not allow ctrl c while in bdos
|
||||
|
||||
push si! push dx! push cx
|
||||
mov cx,f_qread ! mov dx,offset mxdiskqpb
|
||||
call mpmif ;get mxdisk queue
|
||||
pop cx! pop dx! pop si
|
||||
or ax,ax! jz $+5 ;was MXQ read successful?
|
||||
jmp retmonx1 ;no
|
||||
|
||||
mov fx_intrn,cl ;save internal bdos func #
|
||||
mov bx,rlr
|
||||
test p_flag[bx],pf_ctlc
|
||||
jz not_ctlc
|
||||
xor al,al ;AL = no error message to print
|
||||
mov bx,0ffffh
|
||||
jmp retmonxa
|
||||
not_ctlc:
|
||||
cli ;switch to internal bdos stack
|
||||
mov ss_save,ss
|
||||
mov sp_save,sp
|
||||
setup_stack:
|
||||
mov ss,sysdat
|
||||
mov sp,offset bdosstack
|
||||
sti
|
||||
|
||||
mov pdaddr,bx ;BX = rlr
|
||||
|
||||
mov ax,word ptr p_dsk[bx]
|
||||
mov word ptr seldsk,ax ;set default disk and user code
|
||||
|
||||
mov ax,u_wrkseg ;initialize bdos data area for user
|
||||
mov parametersegment,ax
|
||||
mov ax,u_retseg
|
||||
mov returnseg,ax
|
||||
mov u_ioexerr,0FFh ;initialize IOS extended error byte
|
||||
|
||||
push es
|
||||
mov uda_save,es ;save uda segment
|
||||
push si
|
||||
mov ax,ds! mov bx,es ;copy uda bdos vars to local area
|
||||
mov ds,bx! mov es,ax
|
||||
mov si,offset u_dma_ofst
|
||||
mov di,offset dma_ofst
|
||||
mov cx,uda_ovl_len
|
||||
rep movsb
|
||||
mov ds,ax
|
||||
|
||||
mov ax,dma_ofst
|
||||
mov cl,4! shr ax,cl
|
||||
add dma_seg,ax
|
||||
and dma_ofst,000fh
|
||||
|
||||
mov cx,zerolength ! xor al,al ;zero local variables
|
||||
mov di,offset fcbdsk
|
||||
rep stosb
|
||||
|
||||
mov info,dx ;info=dx
|
||||
mov linfo,dl ;linfo = low(info) - don't equ
|
||||
pop si! push si
|
||||
mov ah,cs:btab_flag[si]
|
||||
test ah,bf_fcb33! jz notfcb33 ;if 33 byte fcb
|
||||
call parsave33! jmps notfcb36 ; copy 33 bytes to local FCB
|
||||
notfcb33:
|
||||
test ah,bf_fcb36! jz notfcb36 ;else if 36 byte fcb
|
||||
call parsave36! call save_rr ; copy 36 bytes to local FCB
|
||||
notfcb36: ; and save random record bytes
|
||||
pop si
|
||||
cmp mult_cnt,1 ! je noshell ;if mult_cnt <> 1 and
|
||||
test cs:btab_flag[si],bf_cshell ; func uses mult_cnt then
|
||||
jz noshell
|
||||
call shell ; use bdos multi sector shell
|
||||
jmps retmon
|
||||
noshell:
|
||||
call call_bdos
|
||||
retmon:
|
||||
mov cl,parlg
|
||||
or cl,cl! jz retmon6
|
||||
xor ch,ch ;copy local FCB back to user segment?
|
||||
mov si,offset info_fcb
|
||||
mov di,info
|
||||
mov es,parametersegment
|
||||
rep movsb
|
||||
retmon6:
|
||||
pop es ;restore uda segment
|
||||
mov si,offset dma_ofst+4 ! mov di,offset u_dma_ofst+4
|
||||
mov cx,uda_ovl_len-4
|
||||
rep movsb
|
||||
|
||||
mov ax,returnseg ;setup return registers
|
||||
mov u_retseg,ax
|
||||
mov bx,aret
|
||||
|
||||
pushf ! pop ax ! cli ;switch back to user's stack
|
||||
mov ss,ss_save
|
||||
mov sp,sp_save
|
||||
push ax ! popf
|
||||
|
||||
mov al,err_type
|
||||
retmonxa:
|
||||
push bx ;save return code
|
||||
test al,true
|
||||
jz retmonx
|
||||
js denied_typ
|
||||
push parametersegment ;fcb segment
|
||||
mov bx,0ffffh ;0ffffh => no fcb to print in message
|
||||
test resel,true
|
||||
jz no_fcb
|
||||
mov bx,info ;fcb offset
|
||||
no_fcb:
|
||||
push bx
|
||||
jmps comn_dat
|
||||
denied_typ:
|
||||
push err_pd_addr ;denied error pd address
|
||||
comn_dat:
|
||||
mov ah,err_drv
|
||||
retmonx:
|
||||
push ax ;AL = error message type to print
|
||||
mov cx,f_qwrite ! mov dx,offset mxdiskqpb
|
||||
call mpmif ;release mxdisk queue
|
||||
pop ax
|
||||
test al,0ffh
|
||||
jnz $+5! jmp retmonx1a
|
||||
push ax
|
||||
mov bx,offset msg_spb
|
||||
mov cx,f_sync
|
||||
call mpmif
|
||||
|
||||
cmp word ptr err_intercept+2,0 ;check if error interception
|
||||
je ret_err0 ; no
|
||||
callf dword ptr err_intercept ;call intercept routine
|
||||
jmp free_spb
|
||||
ret_err0:
|
||||
pop ax
|
||||
add ah,'A'
|
||||
test al,0ffh
|
||||
jns $+5! jmp denied_err
|
||||
push ax
|
||||
mov dskerr,ah ;set D: field
|
||||
mov dx,offset dskmsg
|
||||
call xprint ;print "CP/M Error On D:"
|
||||
|
||||
pop ax
|
||||
mov bl,al
|
||||
xor bh,bh
|
||||
shl bx,1
|
||||
mov dx,xerr_list[bx] ;compute extended error message offset
|
||||
call xprint ;print error message
|
||||
|
||||
mov al,u_func ;convert func# to character
|
||||
mov ch,30h
|
||||
mov bx,offset pr_fx1
|
||||
cmp al,100! jb ret_err1
|
||||
mov b[bx],31h
|
||||
inc bx
|
||||
sub al,100
|
||||
ret_err1:
|
||||
sub al,10! jb ret_err2
|
||||
inc ch
|
||||
jmps ret_err1
|
||||
ret_err2:
|
||||
mov [bx],ch
|
||||
inc bx
|
||||
add al,3ah
|
||||
mov [bx],al
|
||||
inc bx
|
||||
mov b[bx],20h
|
||||
mov bx,offset pr_fcb ;0 = message delimiter
|
||||
mov b[bx],0
|
||||
pop si! pop dx ;DX,SI = offset of fcb
|
||||
inc si ;was reselect called?
|
||||
jz ret_err3 ;no - don't print fcb
|
||||
mov b[bx],20h ;remove delimiter
|
||||
mov di,offset pr_fcb1
|
||||
mov ax,ds! mov bx,es
|
||||
mov es,ax ;ES = DS
|
||||
mov ds,dx ;DS = parametersegment
|
||||
mov cx,4 ;move file name to message
|
||||
rep movsw
|
||||
mov es:b[di],'.' ;move '.' to message
|
||||
inc di
|
||||
mov cl,3 ;move file type to message
|
||||
rep movsb
|
||||
mov ds,ax! mov es,bx ;restore DS,ES
|
||||
ret_err3:
|
||||
mov dx,offset pr_fx ;print "bdos function = ### "
|
||||
call xprint ; + "file = ffffffff.ttt"
|
||||
jmps free_spb
|
||||
denied_err:
|
||||
mov denieddrv,ah
|
||||
pop si
|
||||
mov al,p_cns[si]
|
||||
add al,'0'
|
||||
mov deniedcns,al
|
||||
add si,p_name
|
||||
mov di,offset deniedprc
|
||||
push es! push ds! pop es ;ES = DS
|
||||
mov cx,4 ;copy process name to message
|
||||
rep movsw
|
||||
pop es ;restore ES
|
||||
mov dx,offset deniedmsg
|
||||
call xprint
|
||||
free_spb:
|
||||
mov dx,offset crlf_str
|
||||
call xprint
|
||||
mov bx,offset msg_spb
|
||||
mov cx,f_unsync
|
||||
call mpmif
|
||||
retmonx1a:
|
||||
pop bx ;restore retcode
|
||||
retmonx1:
|
||||
mov si,rlr
|
||||
pop ax ;restore tempkeep flag
|
||||
or ax,not pf_tempkeep
|
||||
and p_flag[si],ax
|
||||
test p_flag[si],pf_ctlc ;see if control C occured
|
||||
jz mxdiskexit
|
||||
mov cx,f_terminate! xor dx,dx
|
||||
push bx! call mpmif! pop bx
|
||||
mxdiskexit:
|
||||
ret
|
||||
|
||||
call_bdos:
|
||||
;---------
|
||||
; entry: DX = argument
|
||||
; SI = offset of bdos functab entry
|
||||
|
||||
mov save_sp,sp
|
||||
test cs:btab_flag[si],bf_resel
|
||||
jz cbdos1
|
||||
push si
|
||||
call reselect
|
||||
pop si
|
||||
cbdos1:
|
||||
call cs:btab_addr[si]
|
||||
bdos_return:
|
||||
cmp resel,0
|
||||
je retmon5
|
||||
cmp comp_fcb_cks,true! jne retmon1
|
||||
call set_chksum_fcb
|
||||
retmon1:
|
||||
mov al,xfcb_read_only
|
||||
mov bx,offset info_fcb
|
||||
or f7[bx],al
|
||||
mov al,high_ext
|
||||
cmp al,60h! jne retmon3
|
||||
or byte ptr f8[bx],80h
|
||||
jmps retmon4
|
||||
retmon3:
|
||||
or extnum[bx],al
|
||||
retmon4:
|
||||
mov al,actual_rc
|
||||
or reccnt[bx],al
|
||||
mov al,fcbdsk
|
||||
mov drv[bx],al
|
||||
retmon5:
|
||||
ret
|
||||
|
||||
shell:
|
||||
;-----
|
||||
; entry: SI = offset of functab entry
|
||||
|
||||
mov shell_si,si
|
||||
mov ah,cs:btab_flag[si]
|
||||
mov al,mult_cnt
|
||||
mult_io1:
|
||||
MOV MULT_NUM,AL
|
||||
push ax
|
||||
mov si,shell_si
|
||||
mov dx,info
|
||||
call call_bdos
|
||||
mov bl,byte ptr aret
|
||||
or bl,bl
|
||||
pop ax
|
||||
jz no_shell_err
|
||||
cmp bl,0ffh! je shell04
|
||||
mov bh,mult_cnt
|
||||
sub bh,al ;BH = # of successfull records
|
||||
jmps shell03
|
||||
no_shell_err:
|
||||
test ah,bf_fcb36! jz mult_io2 ;AH = entry functab flags
|
||||
call incr_rr
|
||||
mult_io2:
|
||||
add dma_ofst,80h
|
||||
dec al
|
||||
jnz mult_io1
|
||||
xor bx,bx
|
||||
shell03:
|
||||
mov aret,bx
|
||||
test info_fcb+modnum,80h
|
||||
jnz shell04
|
||||
test high_ext,80h
|
||||
jz shell04
|
||||
push ax! push bx
|
||||
mov si,offset ftab16
|
||||
or info_fcb+f5,80h
|
||||
mov aret,0
|
||||
call call_bdos
|
||||
pop ax
|
||||
cmp lret+1,0
|
||||
jnz shell03b
|
||||
cmp lret,0
|
||||
jz shell03a
|
||||
mov al,11
|
||||
shell03a:
|
||||
mov aret,ax
|
||||
shell03b:
|
||||
pop ax
|
||||
shell04:
|
||||
test ah,bf_fcb36! jz parret
|
||||
;jmps reset_rr
|
||||
|
||||
reset_rr:
|
||||
;--------
|
||||
call save_rr2! jmps save_rr1
|
||||
save_rr:
|
||||
;-------
|
||||
call save_rr2! xchg bx,dx
|
||||
save_rr1:
|
||||
mov cl,3! jmp move
|
||||
save_rr2:
|
||||
mov bx,offset info_fcb+ranrec
|
||||
mov dx,offset shell_rr
|
||||
ret
|
||||
|
||||
parsave33: ;copy 33 byte length FCB
|
||||
;---------
|
||||
mov cl,33
|
||||
jmps parsave
|
||||
|
||||
parsave36: ;copy 36 byte length FCB
|
||||
;---------
|
||||
mov cl,36
|
||||
|
||||
parsave: ;copy FCB from user segment to bdos segment
|
||||
;-------
|
||||
; entry: CL = length of FCB to save
|
||||
|
||||
mov parlg,cl
|
||||
xor ch,ch
|
||||
mov si,info
|
||||
mov di,offset info_fcb
|
||||
push ds
|
||||
mov ds,parametersegment
|
||||
rep movsb
|
||||
pop ds
|
||||
parret:
|
||||
ret
|
||||
|
||||
incr_rr:
|
||||
;-------
|
||||
; exit: AX = preserved
|
||||
|
||||
mov bx,offset info_fcb+ranrec
|
||||
inc w[bx]! jnz incr_rr_ret
|
||||
inc byte ptr 2[bx]
|
||||
incr_rr_ret:
|
||||
ret
|
||||
|
||||
xprint: ;print message at DX
|
||||
;------
|
||||
; entry: DX = offset of message to print
|
||||
|
||||
push dx
|
||||
mov cx,f_cconattch ;make sure we own console before
|
||||
call mpmif ; attempting to print message
|
||||
pop dx
|
||||
or al,al! jnz parret
|
||||
mov cx,f_conprint
|
||||
;jmps mpmif
|
||||
|
||||
;these functions added for mpm interface
|
||||
|
||||
;=====
|
||||
mpmif: ;call mpm function
|
||||
;=====
|
||||
mov si,rlr
|
||||
push es! mov es,p_uda[si]
|
||||
callf cs:dword ptr supervisor
|
||||
pop es
|
||||
ret
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* bdos - xios interface
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
;====== ========================
|
||||
xiosif: ; xios interface routine
|
||||
;====== ========================
|
||||
; entry: AL = function number
|
||||
; CX = argument 1
|
||||
; DX = argument 2
|
||||
; exit: AX = BX = output
|
||||
|
||||
push es! mov es,uda_save
|
||||
callf dword ptr xiosmod
|
||||
cld! pop es
|
||||
ret
|
||||
|
||||
;======== ================================
|
||||
rwxiosif: ; disk read/write xios interface
|
||||
;======== ================================
|
||||
; entry: AL = function number
|
||||
; exit: AX = BX = output
|
||||
|
||||
mov dx,arecord
|
||||
mov ch,byte ptr arecord+2
|
||||
mov bl,curdsk
|
||||
mov bh,1
|
||||
xchg bh,mult_sec ;BH = multi sector count
|
||||
; stack on entry to the xios
|
||||
push bx ; +C | DRV | MCNT |
|
||||
push track ; +A | TRACK |
|
||||
push sector ; +8 | SECTOR |
|
||||
push cur_dma_seg ; +6 | DMA_SEG |
|
||||
push cur_dma ; +4 | DMA_OFF |
|
||||
; +2 | RET_SEG |
|
||||
; SP+0 | RET_OFF |
|
||||
mov es,uda_save
|
||||
callf dword ptr xiosmod
|
||||
add sp,10 ;remove parameters from stack
|
||||
cld! push ds! pop es
|
||||
ret
|
||||
|
||||
;************* end of BDOS interface ****************
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
;
|
||||
; Character Block (CP/M 3.0 Character Control Block)
|
||||
;
|
||||
cb_off equ word ptr 0
|
||||
cb_seg equ word ptr cb_off + word
|
||||
cb_len equ word ptr cb_seg + word
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Character Definitions
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
ctlc equ 003h
|
||||
ctld equ 004h
|
||||
ctle equ 005h
|
||||
bell equ 007h
|
||||
ctlh equ 008h
|
||||
tab equ 009h
|
||||
lf equ 00ah
|
||||
cr equ 00dh
|
||||
ctlp equ 010h
|
||||
ctlq equ 011h
|
||||
ctlr equ 012h
|
||||
ctls equ 013h
|
||||
ctlu equ 015h
|
||||
ctlx equ 018h
|
||||
ctlz equ 01ah
|
||||
ctl equ 05eh
|
||||
rubout equ 07fh
|
||||
|
||||
@@ -0,0 +1,767 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Character I/0 Routines
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
;===========
|
||||
cmode_entry: ;Get/Set Console Mode
|
||||
;===========
|
||||
;
|
||||
; entry: DX = 0FFFFH if returning current value
|
||||
; else DX = new console mode word
|
||||
; return: BX = console mode if DX = 0FFFFH on entry
|
||||
;
|
||||
mov bx,rlr
|
||||
inc dx ! jz cm_get
|
||||
dec dx
|
||||
mov p_conmode[bx],dx
|
||||
xor bx,bx
|
||||
ret
|
||||
cm_get:
|
||||
mov bx,p_conmode[bx]
|
||||
ret
|
||||
|
||||
;===========
|
||||
conin_entry: ;Function 1:console input
|
||||
;===========
|
||||
call coninit
|
||||
call coninf ;char in AL and BL
|
||||
mov dl,al ;PIN handles control chars
|
||||
co_notp:
|
||||
call echoc ! jb ciexit ;check nonprint char
|
||||
call tabout ;echo character - if printable
|
||||
ciexit:
|
||||
mov bl,dl ! ret
|
||||
|
||||
;============
|
||||
conout_entry: ;Function 2:console output - DL = char
|
||||
;============
|
||||
call coninit
|
||||
test p_conmode[bx],pcm_rout ;BX=RLR PD
|
||||
jz co_tab
|
||||
jmp conoutf
|
||||
co_tab:
|
||||
jmp tabout
|
||||
|
||||
;============ ;internal only under CCP/M
|
||||
rconin_entry: ; raw console input
|
||||
;============
|
||||
call rawinit
|
||||
jmp coninf ;returns char in AL and BL
|
||||
|
||||
;============= ;internal only under CCP/M
|
||||
rconout_entry: ; raw console output - DL = char
|
||||
;=============
|
||||
call rawinit
|
||||
rconout:
|
||||
jmp conoutf
|
||||
|
||||
;=============
|
||||
listout_entry: ; write to list device - DL = char
|
||||
;=============
|
||||
mov bx,rlr ! mov dh,p_lst[bx]
|
||||
mov si,u_lstccb
|
||||
push dx ! call lstattach_entry ! pop dx
|
||||
jmp listf
|
||||
|
||||
;=============
|
||||
constat_entry: ;check console status
|
||||
;=============
|
||||
call coninit ;console mode is made "cooked"
|
||||
call cse_cl
|
||||
test bl,bl ! jz co_r ;BL=1 if char ready
|
||||
mov di,rlr
|
||||
test p_conmode[di],pcm_11
|
||||
jz co_r
|
||||
call coninf ;read the char
|
||||
cmp al,ctlc ! jne co_nc ;want only control C
|
||||
mov c_nchar[si],bx ;all 16 bits
|
||||
mov bl,1
|
||||
co_r:
|
||||
ret ;return BL=0 or 1
|
||||
co_nc:
|
||||
xor bl,bl ! ret ;char not a ^C
|
||||
|
||||
;=======
|
||||
ciostat: ; check status w/out changing pf_raw
|
||||
;=======
|
||||
mov bx,rlr
|
||||
mov dh,p_cns[bx]
|
||||
mov si,u_conccb
|
||||
test si,si ;U_CONCCB=0 if no attach yet
|
||||
jz cse_no
|
||||
cmp bx,c_attach[si]
|
||||
je cse_cl
|
||||
cse_no:
|
||||
mov cl,f_dispatch ! call osif
|
||||
mov bl,0 ! ret
|
||||
cse_cl:
|
||||
call constf
|
||||
test bl,bl ! jz cse_c2
|
||||
mov bl,1
|
||||
cse_c2:
|
||||
mov al,bl ! ret
|
||||
|
||||
;===========
|
||||
dirio_entry: ;function 6
|
||||
;===========
|
||||
; direct console i/o - read if 0ffh
|
||||
; entry: DL = 0ffh if readif (ret=0 on not ready, else char)
|
||||
; = 0feh if status (ret=0 not read or 0ffh if ready)
|
||||
; = 0fdh if input (wait there is a character)
|
||||
; = char to output
|
||||
; exit: BL = 0, 0ffh or character if status or input
|
||||
|
||||
call rawinit
|
||||
cmp dl,0fdh
|
||||
jb rconout ;output DL
|
||||
ja diosts
|
||||
jmp coninf ;DL=0FDh, get char
|
||||
diosts: ;some type of status
|
||||
call constf
|
||||
cmp dl,0feh ! jne diocin ;DL=0FEh, return status
|
||||
dio1:
|
||||
ret ;BL=0FFh or 0h
|
||||
diocin:
|
||||
test bl,bl ! jz dio1 ;DL=0FFh, if char,conin
|
||||
jmp coninf
|
||||
|
||||
;==============
|
||||
conwrite_entry: ;write line until delimiter in UDA encountered
|
||||
;============== ;user function 9, delimiter set by function 110
|
||||
;
|
||||
; input: DX = buffer addr in u_wrkseg
|
||||
|
||||
push dx
|
||||
call coninit
|
||||
pop bx
|
||||
|
||||
cwr1: push ds ! mov ds,u_wrkseg
|
||||
mov dl,[bx] ! pop ds
|
||||
cmp dl, u_delim ! je cwr_e
|
||||
push bx
|
||||
mov bx,rlr
|
||||
test p_conmode[bx],pcm_rout ! jz cw_tab
|
||||
call conoutf ! jmps cw_notab
|
||||
cw_tab:
|
||||
call tabout
|
||||
cw_notab:
|
||||
pop bx
|
||||
inc bx ! jmps cwr1
|
||||
cwr_e: ret
|
||||
|
||||
;===========
|
||||
delim_entry: ;get/set output delimiter, user function 110
|
||||
;===========
|
||||
;
|
||||
; entry: DX = 0FFFFH if returning current delimiter
|
||||
; else DL = new delimiter
|
||||
; return: BL = delimiter if DX = 0FFFFH on entry
|
||||
|
||||
cmp dx,0FFFFH ! jz d_get
|
||||
mov u_delim,dl
|
||||
ret
|
||||
d_get:
|
||||
mov bl,u_delim
|
||||
ret
|
||||
|
||||
;=============
|
||||
p_block_entry:
|
||||
;=============
|
||||
; entry: DX = CB addr where 1st word is offset,
|
||||
; 2nd word is segment, 3rd word
|
||||
; is length
|
||||
; return: None
|
||||
|
||||
push dx
|
||||
call coninit ;BX=PD address
|
||||
pop di
|
||||
xor ax,ax
|
||||
mov bp,p_conmode[bx]
|
||||
jmps block_out
|
||||
|
||||
;=============
|
||||
l_block_entry:
|
||||
;=============
|
||||
; return: None
|
||||
; entry: DX = CB addr where 1st word is offset,
|
||||
; 2nd word is segment, 3rd word
|
||||
; is length
|
||||
|
||||
push dx
|
||||
call lstattach_entry
|
||||
pop di
|
||||
mov bx,rlr ! mov dh,p_lst[bx]
|
||||
mov ax,0ffffh
|
||||
;jmps block_out
|
||||
;SI -> CCB or LCB (in XIOS)
|
||||
block_out: ;u_wrkseg:DI -> user's parameter block
|
||||
;DH=list or console device number
|
||||
;AX = 0 if console, 0FFFFH if list
|
||||
push ds ! mov ds,u_wrkseg
|
||||
mov cx,cb_len[di] ;CX = string length
|
||||
mov bx,cb_seg[di]
|
||||
mov di,cb_off[di] ;BX:DI = string start
|
||||
pop ds
|
||||
test cx,cx ! jz b_ret ;test for zero length
|
||||
|
||||
b_loop: ;BX:DI -> string to print or list
|
||||
;AX = 0 if to console = 0FFFFH if to list
|
||||
;BP = p_conmode if going to console
|
||||
push ds ! mov ds,bx
|
||||
mov dl,[di]
|
||||
pop ds
|
||||
push bp ! push di ! push cx ! push bx ! push ax
|
||||
test ax,ax ! jz b_con
|
||||
call listf ! jmps nb_nxt
|
||||
b_con:
|
||||
test bp,pcm_rout ! jnz nb_nt ;raw output mode ?
|
||||
call tabout ! jmps nb_nxt ;test for ctrlP ?
|
||||
nb_nt:
|
||||
call conoutf
|
||||
nb_nxt:
|
||||
pop ax ! pop bx ! pop cx ! pop di ! pop bp
|
||||
inc di
|
||||
loop b_loop
|
||||
b_ret:
|
||||
ret
|
||||
|
||||
|
||||
;==============
|
||||
conprint_entry: ;write line until delimiter or max
|
||||
;============== ;mask parity, do not check for ctrl chars
|
||||
;
|
||||
; input: DX = address of buffer in u_wrkseg
|
||||
; BH = max characters (0=no max)
|
||||
; BL = delimiter character
|
||||
|
||||
push bx ! push dx
|
||||
call coninit
|
||||
pop bx ! pop ax
|
||||
xor cx,cx
|
||||
and al,07fh
|
||||
; AH=max, AL=delimiter, BX->buffer
|
||||
; CX = count = 0
|
||||
cpr1: cmp ah,0 ! je cpr2
|
||||
cmp ah,cl ! je cpr_e
|
||||
cpr2: push ds ! mov ds,u_wrkseg
|
||||
mov dl,[bx] ! pop ds
|
||||
and dl,07fh
|
||||
cpr3: cmp dl,al ! je cpr_e
|
||||
push ax ! push cx ! push bx
|
||||
call conoutf
|
||||
call chk_ctrlP
|
||||
pop bx ! pop cx ! pop ax
|
||||
inc cl ! inc bx
|
||||
jmps cpr1
|
||||
cpr_e: ret
|
||||
|
||||
;=============
|
||||
conread_entry: ;read a buffered console line
|
||||
;=============
|
||||
; buffer=(max length, current length, buffer)
|
||||
|
||||
push dx
|
||||
call coninit
|
||||
pop bx
|
||||
read: push bx ;[SP] = buffer offset
|
||||
mov al,c_column[si]
|
||||
mov c_strtcol[si],al ;start column = current column
|
||||
xor bx,bx ;BX = character count
|
||||
|
||||
;read next character, CX, BX active
|
||||
readnx: push bx
|
||||
readn0: call coninf ;AX, BX = 16 bit char just read
|
||||
mov dl,al
|
||||
pop bx
|
||||
|
||||
; Carriage Return
|
||||
cmp dl,cr ! jnz notcr
|
||||
eofre: jmp readen
|
||||
notcr:
|
||||
; Line Feed
|
||||
cmp dl,lf ! jz eofre
|
||||
|
||||
tryh: ; Backspace
|
||||
cmp dl,ctlh ! jnz noth
|
||||
or bl,bl ! jz readnx ;if not 1st char
|
||||
dec bl ! mov al,c_column[si] ;decrement char count
|
||||
mov c_btmp[si],al ;temporary hold
|
||||
or c_flag[si],cf_compc ! jmp linelen
|
||||
noth:
|
||||
; Rubout
|
||||
|
||||
cmp dl,rubout ! jnz notrub
|
||||
or bl,bl ! jz readnxx ;only if not 1st char
|
||||
pop di ! push di
|
||||
push ds ! mov ds,u_wrkseg
|
||||
mov dl,1[di+bx] ! pop ds ;make char=last char
|
||||
dec bx ;dec char count
|
||||
jmp rdech1 ;echo, read next
|
||||
readnxx: jmp readnx
|
||||
notrub:
|
||||
; Control E
|
||||
|
||||
cmp dl,ctle ! jnz note
|
||||
push bx
|
||||
mov dl,cr ! call conoutf
|
||||
mov dl,lf ! call conoutf
|
||||
mov c_column[si],0
|
||||
mov c_strtcol[si],0
|
||||
jmp readn0
|
||||
note:
|
||||
; Control X
|
||||
cmp dl,ctlx ! jnz notx
|
||||
backx: mov al,c_strtcol[si]
|
||||
cmp al,c_column[si] ! jb backxxx
|
||||
xor bx,bx ! jmps readnxx
|
||||
backxxx: mov dl,ctlh ! call conoutf
|
||||
mov dl,' ' ! call conoutf
|
||||
mov dl,ctlh ! call conoutf
|
||||
dec c_column[si]
|
||||
jmps backx
|
||||
notx:
|
||||
; Control U
|
||||
cmp dl,ctlu ! jnz notu
|
||||
call crlfp
|
||||
pop bx ! jmp read
|
||||
notu:
|
||||
; CONTROL R - redraw line
|
||||
cmp dl,ctlr ! jnz notr
|
||||
linelen: push bx ! call crlfp
|
||||
;print buffer on screen
|
||||
pop cx ! xor bx,bx
|
||||
rep0: or cl,cl ! jz rep1
|
||||
pop di ! push di
|
||||
push ds ! mov ds,u_wrkseg
|
||||
inc bx ! dec cl
|
||||
mov dl,1[di+bx] ! pop ds ;DL = nxt char
|
||||
mov ch,bl ! push cx
|
||||
call ctlout
|
||||
pop cx ! mov bh,0 ! mov bl,ch
|
||||
jmps rep0
|
||||
rep1: test c_flag[si],cf_compc
|
||||
push bx ! jz l_22
|
||||
and c_flag[si],not cf_compc
|
||||
mov ah,c_btmp[si] ! mov al,ah
|
||||
backsp: cmp al,c_column[si]
|
||||
jb l_22
|
||||
sub al,c_column[si]
|
||||
or al,al ! jz l_22
|
||||
push ax
|
||||
mov dl,ctlh ! call conoutf
|
||||
mov dl,' ' ! call conoutf
|
||||
mov dl,ctlh ! call conoutf
|
||||
pop ax ! dec ah ! mov al,ah
|
||||
jmps backsp
|
||||
l_22: jmp readn0
|
||||
notr:
|
||||
; All other characters
|
||||
rdecho: inc bx
|
||||
pop di ! push di
|
||||
push ds ! mov ds,u_wrkseg
|
||||
mov 1[di+bx],dl ! pop ds
|
||||
rdech1: push bx ! call ctlout ! pop bx
|
||||
pop di ! push di
|
||||
push ds ! mov ds,u_wrkseg
|
||||
cmp bl,[di] ! pop ds ! jae readen
|
||||
push bx ! jmps l_22
|
||||
; End of Console String
|
||||
readen: pop di
|
||||
push ds ! mov ds,u_wrkseg
|
||||
mov 1[di],bl ! pop ds
|
||||
mov dl,cr ! call conoutf
|
||||
mov c_column[si],0
|
||||
ret
|
||||
|
||||
rawinit:
|
||||
;-------
|
||||
mov bx,rlr ;turn on raw flag
|
||||
or p_flag[bx],pf_raw
|
||||
jmps ninit
|
||||
|
||||
coninit:
|
||||
;-------
|
||||
; entry: DL = char if called by output routine
|
||||
; exit: DH = console device number
|
||||
; BX = RLR PD - raw flag turned off
|
||||
; SI = CCB owned by calling PD
|
||||
|
||||
mov bx,rlr ;turn off raw flag
|
||||
and p_flag[bx],not pf_raw
|
||||
ninit:
|
||||
mov dh,p_cns[bx]
|
||||
mov si,u_conccb
|
||||
test si,si ! jz attach
|
||||
cmp c_attach[si],bx
|
||||
jne attach
|
||||
ret
|
||||
|
||||
attach:
|
||||
; exit: SI=CCB
|
||||
; BX,DX preserved
|
||||
|
||||
push bx ! push dx
|
||||
call conattach_entry
|
||||
pop dx ! pop bx
|
||||
ret
|
||||
|
||||
echoc:
|
||||
;-----
|
||||
; check if character is graphic
|
||||
; input: DL = character
|
||||
; DH = console #
|
||||
; SI = CCB address
|
||||
; output: carry set if not graphic
|
||||
; DL,DH,SI pass through
|
||||
|
||||
cmp dl,cr ! je ret0
|
||||
cmp dl,lf ! je ret0
|
||||
cmp dl,tab ! je ret0
|
||||
cmp dl,ctlh ! je ret0
|
||||
cmp dl,' '
|
||||
ret0: ret
|
||||
|
||||
prcsmsg:
|
||||
;-------
|
||||
; print string in Code Segment
|
||||
; input: DX->null terminated string in CS
|
||||
|
||||
xor bx,bx ! mov ax,cs
|
||||
prstr: push u_wrkseg
|
||||
mov u_wrkseg,ax
|
||||
call conprint_entry
|
||||
pop u_wrkseg ! ret
|
||||
|
||||
prname:
|
||||
;------
|
||||
; print name
|
||||
; input: DX->8 char name in DS
|
||||
|
||||
mov bh,8 ! mov bl,' '
|
||||
mov ax,ds ! jmps prstr
|
||||
|
||||
|
||||
conout:
|
||||
;------
|
||||
; compute character position/write console
|
||||
; input: DL = character
|
||||
; DH = console #
|
||||
; SI = ccb address
|
||||
; output: DL = character
|
||||
; DH = console #
|
||||
; SI = ccb address
|
||||
|
||||
;check if only calculating column position
|
||||
test c_flag[si],cf_compc ! jnz compout
|
||||
;write the character, then compute column.
|
||||
call conoutf
|
||||
mov bx,rlr
|
||||
test p_conmode[bx],pcm_rout
|
||||
jnz co_np
|
||||
call chk_ctrlP ;printer echo handling
|
||||
co_np:
|
||||
|
||||
;compute column position
|
||||
compout:
|
||||
mov al,c_column[si]
|
||||
cmp dl,rubout ! je ccret
|
||||
inc al
|
||||
cmp dl,' ' ! jae ccret
|
||||
dec al
|
||||
or al,al ! jz ccret
|
||||
cmp dl,ctlh ! jnz notbs
|
||||
dec al ! jmps ccret
|
||||
notbs: cmp dl,cr ! jne ccret
|
||||
mov al,0
|
||||
ccret: mov c_column[si],al
|
||||
ret
|
||||
|
||||
|
||||
chk_ctrlP:
|
||||
;---------
|
||||
; Entry: SI=CCB address
|
||||
; DH=console device number
|
||||
; DL=character just sent to console
|
||||
; Exit: SI,DX preserved
|
||||
|
||||
; Echo the character to the printer if the ctrlP flag is set
|
||||
; in the CCB, and the ctrlO flag is off, and the cf_bufp
|
||||
; flag is off. Cf_bufp is set when we send a character
|
||||
; to a VOUT process when we are a background buffered
|
||||
; console. The VOUT process decides whether to send the
|
||||
; character to the screen when it purges the buffered output.
|
||||
|
||||
mov ax,c_state[si]
|
||||
test ax,csm_ctrlP
|
||||
jz cp_ret
|
||||
test ax,csm_ctrlO
|
||||
jnz cp_ret
|
||||
mov al,c_flag[si]
|
||||
test al,cf_bufp
|
||||
jz cp_listit
|
||||
and c_flag[si],not cf_bufp ;turn off the flag
|
||||
jmps cp_ret
|
||||
cp_listit:
|
||||
push dx ! push si
|
||||
mov dh,c_mimic[si]
|
||||
cmp dh,0ffh ;mimic = 0ffh if
|
||||
je cp_no ;PIN turned off ^P
|
||||
call listf
|
||||
cp_no:
|
||||
pop si ! pop dx
|
||||
cp_ret:
|
||||
ret
|
||||
|
||||
ctlout:
|
||||
;------
|
||||
; send CTRL character with possible preceding up-arrow
|
||||
; input: DL = character
|
||||
; DH = console #
|
||||
; SI = ccb address
|
||||
; output: DL,DH = character,console
|
||||
; SI = ccb address
|
||||
|
||||
call echoc ! jae tabout
|
||||
push dx ! mov dl,ctl ! call conout
|
||||
pop dx ! or dl,40h
|
||||
; jmp tabout
|
||||
|
||||
tabout:
|
||||
;------
|
||||
; expand tabs to console
|
||||
; input: DL = character
|
||||
; DH = console
|
||||
; SI = ccb address
|
||||
; output: DL,DH = char,console
|
||||
; SI = ccb address
|
||||
|
||||
|
||||
cmp dl,tab ! je tab1
|
||||
jmp conout
|
||||
tab1:
|
||||
mov dl,' '
|
||||
tab0: call conout
|
||||
mov al,c_column[si]
|
||||
and al,111b ! jnz tab0
|
||||
mov dl,tab
|
||||
ret2: ret
|
||||
|
||||
crlf:
|
||||
;----
|
||||
push dx ! mov dl,cr ! call conout
|
||||
mov dl,lf ! call conout ! pop dx
|
||||
ret
|
||||
crlfp:
|
||||
;-----
|
||||
; print #, cr, lf for ctlx, ctlu, ctlr functions
|
||||
; then print ' ' until we are at strtcol (starting column)
|
||||
; input: DH = console
|
||||
; SI = ccb address
|
||||
; output: DH = console
|
||||
; SI = ccb address
|
||||
|
||||
mov dl,'#' ! call conout
|
||||
call crlf
|
||||
mov dl,' '
|
||||
crlfp0: mov al,c_column[si]
|
||||
cmp al,c_strtcol[si] ! jae crlfp1
|
||||
call conout ! jmps crlfp0
|
||||
crlfp1: ret
|
||||
|
||||
;
|
||||
; XIOS CHARACTER I/O INTERFACE
|
||||
;
|
||||
|
||||
|
||||
; XIOS CONSTAT CALL
|
||||
;
|
||||
; entry: DH = console #
|
||||
; SI = ccb address
|
||||
; returns:DH = console #
|
||||
; SI = ccb address
|
||||
; AX = BX = 0 if no char, = 0FFH if char ready
|
||||
|
||||
constf:
|
||||
cmp dh,ncns ;if not VC goto XIOS
|
||||
jb cst_vc
|
||||
mov al,io_const
|
||||
jmp goxios
|
||||
cst_vc:
|
||||
xor bx,bx
|
||||
cmp c_nchar[si],bx
|
||||
jne cst_true
|
||||
mov di,c_vinq[si]
|
||||
cmp q_msgcnt[di],bx ;number of chars in type ahead
|
||||
je cst_ret ;queue
|
||||
cst_true:
|
||||
mov bl,0ffh ;char ready
|
||||
cst_ret:
|
||||
mov al,bl
|
||||
ret
|
||||
|
||||
|
||||
; XIOS CONIN CALL
|
||||
;
|
||||
; entry: DH = console #
|
||||
; SI = ccb address
|
||||
; returns:DH = console #
|
||||
; AL = BL = character
|
||||
; SI = ccb address
|
||||
;
|
||||
coninf:
|
||||
cmp dh,ncns ;if not VC goto XIOS
|
||||
jb ci_vc
|
||||
mov dl,c_pc[si] ;io_conin needs physical console #
|
||||
mov al,io_conin
|
||||
jmp goxios
|
||||
ci_vc:
|
||||
cmp c_nchar[si],0
|
||||
jne ci_gotc
|
||||
mov cx,f_qread
|
||||
call csi_readq
|
||||
ci_gotc:
|
||||
mov bx,c_nchar[si]
|
||||
mov ax,bx
|
||||
mov c_nchar[si],0
|
||||
ret
|
||||
|
||||
csi_readq:
|
||||
push dx ! push si
|
||||
mov ax,c_vinq[si]
|
||||
mov c_qpbqaddr[si],ax
|
||||
lea ax,c_nchar[si]
|
||||
mov c_qpbbuffptr[si],ax
|
||||
lea dx,c_qpbflags[si]
|
||||
call osif
|
||||
pop si ! pop dx
|
||||
ret
|
||||
|
||||
|
||||
; XIOS CONOUT CALL
|
||||
;
|
||||
; entry: DH = console #
|
||||
; DL = character
|
||||
; SI = ccb address
|
||||
; exit: DH = console #
|
||||
; SI = ccb address
|
||||
|
||||
conoutf:
|
||||
cmp dh,ncns ;if not VC goto XIOS
|
||||
jb co_vc
|
||||
mov al,io_conout ;console number
|
||||
jmp goxios ;control C could hang up this
|
||||
co_vc: ;hardware, should handle similar
|
||||
pushf ! cli ;to virtual screens
|
||||
mov ax,c_state[si]
|
||||
mov bx,ax
|
||||
and ax,not(csm_ctrlP + csm_ctrlO + csm_noswitch + csm_suspend)
|
||||
cmp ax,2 ;0=foreground&dynamic, 1=foreground&
|
||||
jbe co_getconout ;buffered, 2=background&dynamic
|
||||
|
||||
cmp ax,csm_buffered + csm_background
|
||||
je co_buffer
|
||||
;sleep on all other states
|
||||
push dx ! push si ;and wait for the PIN or
|
||||
lea dx, c_usleep[si] ;VOUT to wake us up
|
||||
mov bl, ps_ciowait
|
||||
mov cx, f_sleep
|
||||
call osif
|
||||
pop si ! pop dx
|
||||
popf
|
||||
jmps co_vc ;start over, state could
|
||||
;have changed
|
||||
|
||||
co_buffer: ;Virtual Console is in some type of buffered state
|
||||
popf ;allow interrupts
|
||||
or c_flag[si],cf_vout+cf_bufp ;VOUT we are writing a msg.
|
||||
;If we switch screens, and VOUT
|
||||
;just finishes purging, VOUT
|
||||
;will wait for this message.
|
||||
;Turn on cf_bufp so we don't
|
||||
;echo to the printer if ctrlP is on
|
||||
mov ax,c_voutq[si]
|
||||
mov c_qpbqaddr[si],ax
|
||||
lea ax,c_qbuff[si] ;points to 2-byte message
|
||||
mov c_qpbbuffptr[si],ax
|
||||
push dx ! push si
|
||||
xor dh,dh ;DL = data, DH = data msg type (0)
|
||||
mov c_qbuff[si],dx
|
||||
lea dx,c_qpbflags[si]
|
||||
mov cx, f_qwrite
|
||||
call osif
|
||||
pop si ! pop dx
|
||||
and c_flag[si],not cf_vout ;tell VOUT we're done writing
|
||||
ret ;message
|
||||
|
||||
co_getconout:
|
||||
test bx,csm_ctrlO ;BX = ccb.state
|
||||
jz co_cbitsget ;famous racehorse
|
||||
popf ! ret ;ctrl O byte bucket
|
||||
co_cbitsget: ;output is going to XIOS,
|
||||
;ensure no other process
|
||||
test c_flag[si],cf_conout ;is in XIOS console output code
|
||||
jz co_gotconout ;for this screen
|
||||
|
||||
co_conoutsleep:
|
||||
push dx ! push si
|
||||
lea dx, c_cosleep[si]
|
||||
mov bl, ps_ciowait
|
||||
mov cx, f_sleep
|
||||
call osif
|
||||
pop si ! pop dx
|
||||
popf
|
||||
jmp co_vc ;start over, state
|
||||
;could have changed
|
||||
co_gotconout:
|
||||
or c_flag[si], cf_conout ;set XIOS conout "ownership" flag
|
||||
popf ;allow interrupts
|
||||
mov bx,rlr
|
||||
push p_flag[bx] ;save flags
|
||||
or p_flag[bx],pf_tempkeep ;don't allow abort
|
||||
push bx
|
||||
mov ax,io_conout ;XIOS function number
|
||||
call goxios
|
||||
and c_flag[si], not cf_conout ;wake any process wanting XIOS
|
||||
cmp c_cosleep[si],0 ;test here for faster output
|
||||
je co_nowake
|
||||
push dx ! push si
|
||||
mov cx,f_wakeup
|
||||
mov bl,ps_ciowait
|
||||
lea dx,c_cosleep[si]
|
||||
call osif
|
||||
pop si ! pop dx
|
||||
co_nowake:
|
||||
pop bx ;process address
|
||||
test p_flag[bx],pf_ctlc ;was ^C typed ?
|
||||
pop p_flag[bx] ;restore PD flags
|
||||
jz co_xret
|
||||
or p_flag[bx],pf_ctlc
|
||||
push dx ! push si
|
||||
xor dx,dx
|
||||
mov cx,f_terminate
|
||||
call osif ;returns here if keep flg is on
|
||||
pop si ! pop dx
|
||||
co_xret:
|
||||
ret
|
||||
|
||||
; XIOS LIST OUT CALL
|
||||
;
|
||||
; entry: DH = console #
|
||||
; DL = character
|
||||
; SI = ccb address
|
||||
; exit: DH = console #
|
||||
; SI = ccb address
|
||||
|
||||
listf:
|
||||
mov ax,io_list
|
||||
;jmps goxios
|
||||
|
||||
goxios:
|
||||
push dx ! push si
|
||||
mov cl,dl ! mov dl,dh ;CL = char, DL = device
|
||||
call xiosif
|
||||
pop si ! pop dx
|
||||
ret
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Concurrent CP/M-86 Character I/O Interface
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
CSEG
|
||||
org 0
|
||||
|
||||
jmp init
|
||||
jmp entry
|
||||
|
||||
;3 variables set by GENSYS
|
||||
sysdat dw 0
|
||||
supervisor equ (offset $)
|
||||
rw 2
|
||||
|
||||
org 0ch
|
||||
dev_ver db 6 ;development system data version
|
||||
;set in sysdat.fmt
|
||||
|
||||
db 'COPYRIGHT (C) 1982,1983,1984'
|
||||
db ' DIGITAL RESEARCH '
|
||||
db 'XXXX-0000-'
|
||||
serial db '654321'
|
||||
|
||||
;====
|
||||
init:
|
||||
;====
|
||||
retf
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* CIO function table
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
functab dw conin_entry ; 0 - Console Input
|
||||
dw conout_entry ; 1 - Console Output
|
||||
dw rconin_entry ; 2 - raw console input
|
||||
dw rconout_entry ; 3 - raw console output
|
||||
dw listout_entry ; 4 - list output
|
||||
dw dirio_entry ; 5 - direct console I/O
|
||||
dw conwrite_entry ; 6 - print string
|
||||
dw conread_entry ; 7 - read buffer
|
||||
dw constat_entry ; 8 - console status
|
||||
dw conattach_entry ; 9 - attach console
|
||||
dw condetach_entry ; 10- detach console
|
||||
dw setdefcon_entry ; 11- set default console
|
||||
dw conassign_entry ; 12- assign console
|
||||
dw getdefcon_entry ; 13- get default console
|
||||
dw conprint_entry ; 14- print string (internal)
|
||||
dw lstattach_entry ; 15- attach list
|
||||
dw lstdetach_entry ; 16- detach list
|
||||
dw setdeflst_entry ; 17- set default list
|
||||
dw clstattch_entry ; 18- cond list attach
|
||||
dw cconattch_entry ; 19- cond list detach
|
||||
dw getdeflst_entry ; 20- get default list
|
||||
dw notimp ; 21
|
||||
dw notimp ; 22
|
||||
dw cioterm ; 23- cleanup for term.
|
||||
dw ciostat ; 24- check status w/out
|
||||
; changing raw/cooked flag
|
||||
dw cmode_entry ; 25- get/set console mode word -
|
||||
; user func 109
|
||||
dw delim_entry ; 26- get/set delimiter - user func 110
|
||||
dw pblock_entry ; 27- print block - user func 111
|
||||
dw lblock_entry ; 28- list block - user func 112
|
||||
|
||||
;===== =================
|
||||
entry: ; CIO entry point
|
||||
;===== =================
|
||||
shl cx,1 ! mov si,cx
|
||||
call cs:functab[si] ! retf
|
||||
|
||||
;==== ==============
|
||||
osif: ; OS interface
|
||||
;==== ==============
|
||||
callf cs:dword ptr .supervisor ! ret
|
||||
|
||||
;====== ================
|
||||
xiosif: ; XIOS interface
|
||||
;====== ================
|
||||
callf dword ptr .xiosmod ! ret
|
||||
|
||||
;======
|
||||
notimp:
|
||||
;======
|
||||
mov bx,0ffffh
|
||||
ret
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Cli Command Control Block
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
clicb_net equ byte ptr 0
|
||||
clicb_cmd equ byte ptr clicb_net + byte
|
||||
|
||||
clicblen equ clicb_cmd + 129*byte
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Command Header Format and Load Fixup Records
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
;group descriptor format
|
||||
ch_form equ byte ptr 0
|
||||
ch_length equ word ptr (ch_form + byte)
|
||||
ch_base equ word ptr (ch_length + word)
|
||||
ch_min equ word ptr (ch_base + word)
|
||||
ch_max equ word ptr (ch_min + word)
|
||||
chlen equ ch_max + word
|
||||
|
||||
ch_entmax equ 8 ;max number of group
|
||||
;descriptors
|
||||
|
||||
ch_lbyte equ byte ptr 07fh ;MSB bit in CH_LBYTE
|
||||
ch_fixrec equ word ptr 07dh ;signals fixup records
|
||||
;start at record number
|
||||
;in CH_FIXREC
|
||||
|
||||
fix_grp equ byte ptr 0 ;format of fixup record
|
||||
fix_para equ word ptr fix_grp + byte
|
||||
fix_offs equ byte ptr fix_para + word
|
||||
fixlen equ fix_offs + byte
|
||||
|
||||
; Flag def's for ch_lbyte
|
||||
need_fxps equ 080H ;need fixup records
|
||||
opt_8087 equ 040H ;optional 8087 request
|
||||
need_8087 equ 020H ;requires 8087
|
||||
need_rsx equ 010H ;requires rsx load
|
||||
susp_mode equ 008H ;suspend if background task
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
;
|
||||
; Bit masks for the console mode word
|
||||
;
|
||||
cm_ctlc equ 0001H
|
||||
cm_ctls equ 0002H
|
||||
cm_rawo equ 0004H
|
||||
cm_rsx1 equ 0100H
|
||||
cm_rsx2 equ 0200H
|
||||
|
||||
|
||||
@@ -0,0 +1,449 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Character I/O ownership routines
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
;===============
|
||||
lstattach_entry:
|
||||
;===============
|
||||
xor cx,cx ;unconditional attach code
|
||||
jmps lcb_verify
|
||||
|
||||
;===============
|
||||
clstattch_entry:
|
||||
;===============
|
||||
mov cx,0ffffh ;conditional attach code
|
||||
|
||||
lcb_verify:
|
||||
;----------
|
||||
push cx
|
||||
mov si,u_lstccb ;U_LSTCCB=0 if not yet initialized
|
||||
test si,si ! jnz lcb_ok
|
||||
call getlcbadr
|
||||
mov u_lstccb,si
|
||||
lcb_ok:
|
||||
pop cx ;restore attach code
|
||||
jmps cioattach
|
||||
|
||||
;===============
|
||||
conattach_entry:
|
||||
;===============
|
||||
xor cx,cx ;unconditional attach code
|
||||
jmps ccb_verify
|
||||
|
||||
;===============
|
||||
cconattch_entry:
|
||||
;===============
|
||||
mov cx,0ffffh ;conditional attach code
|
||||
ccb_verify:
|
||||
push cx
|
||||
mov si,u_conccb
|
||||
test si,si ! jnz ccb_ok
|
||||
call getccbadr
|
||||
mov u_conccb,si
|
||||
ccb_ok:
|
||||
pop cx ;conditional attach if 0ffffh
|
||||
;jmps cioattach
|
||||
|
||||
;=========
|
||||
cioattach: ;NOTE: PIN does attaches also for ^P
|
||||
;=========
|
||||
; Attach calling process to default ciodev.
|
||||
; if ciodev is being used, sleep on c_queue
|
||||
; until another process detaches from device
|
||||
; and calling process is next in queue.
|
||||
; input: SI = CCB address of device
|
||||
; DI = offset of dev number in PD
|
||||
; CX = 0ffffh if conditional
|
||||
|
||||
mov ax,rlr ! mov bx,ax
|
||||
; BX = PD addr
|
||||
; SI = CCB addr
|
||||
; CX = Condition Flag
|
||||
pushf ! cli
|
||||
cmp bx,c_attach[si] ! je ca_ret ;we already own it
|
||||
cmp c_attach[si],0 ! je ca_atch ;nobody owns it, we'll take it
|
||||
jcxz ca_sleep ;somebody else owns it
|
||||
popf ! mov bx,0ffffh ;or it is a mimic list (0ffffh)
|
||||
mov cx,e_no_attach ! ret ;- no attach in either case
|
||||
ca_sleep:
|
||||
push dx ;save DH=cons #
|
||||
lea dx,c_queue[si] ;unconditional if CX=0
|
||||
mov bl,ps_ciowait
|
||||
push si
|
||||
mov cx,f_sleep ! call osif
|
||||
pop si ! pop dx ! popf ! xor cx,cx
|
||||
jmps cioattach
|
||||
ca_atch: mov c_attach[si],bx
|
||||
ca_ret: popf ! xor bx,bx ! ret
|
||||
|
||||
;===============
|
||||
lstdetach_entry:
|
||||
;===============
|
||||
call lcb_verify ;ensure U_LSTCCB is non zero
|
||||
|
||||
lst_det:
|
||||
mov bx,rlr
|
||||
pushf ! cli
|
||||
cmp c_attach[si],0 ! je cd_ret
|
||||
cmp c_attach[si],bx ! je ld_detach
|
||||
popf ! mov bx,0ffffh
|
||||
mov cx, e_not_owner ! ret
|
||||
ld_detach:
|
||||
mov ax,c_queue[si]
|
||||
mov c_attach[si],ax
|
||||
mov cx,f_wakeup
|
||||
lea dx,c_queue[si]
|
||||
call osif
|
||||
jmps cd_ret
|
||||
|
||||
;===============
|
||||
condetach_entry:
|
||||
;===============
|
||||
call ccb_verify ;ensure U_CONCCB is non zero
|
||||
;jmps ciodetach
|
||||
|
||||
;=========
|
||||
ciodetach: ;NOTE PIN also does detaching for ^P
|
||||
;=========
|
||||
; Detach Calling process from default ciodev.
|
||||
; If current owner of ciodev then zero c_attach
|
||||
; and wakeup the c_queue list to give another
|
||||
; process the ciodev.
|
||||
; input: SI = CCB addr of device
|
||||
|
||||
mov bx,rlr
|
||||
; SI = CCB address
|
||||
; BX = PD address
|
||||
pushf ! cli
|
||||
cmp c_attach[si],0 ! je cd_ret
|
||||
cmp c_attach[si],bx ! je cd_detach
|
||||
popf ! mov bx,0ffffh
|
||||
mov cx,e_not_owner ! ret
|
||||
cd_detach:
|
||||
and c_state[si],not (csm_suspend ); turn off suspend mode
|
||||
mov ax,c_queue[si]
|
||||
mov c_attach[si],ax
|
||||
mov cx,f_wakeup
|
||||
lea dx,c_queue[si]
|
||||
call osif
|
||||
cd_ret:
|
||||
popf
|
||||
xor bx,bx ! ret
|
||||
|
||||
|
||||
;===============
|
||||
conassign_entry:
|
||||
;===============
|
||||
; Attach specified console to specified process
|
||||
;
|
||||
; entry: U_WRKSEG:DX -> ACB
|
||||
;
|
||||
; +-----+-----+-----+-----+
|
||||
; | CNS |Match| PD Addr |
|
||||
; +-----+-----+-----+-----+-----+-----+-----+-----+
|
||||
; | Name |
|
||||
; +-----+-----+-----+-----+-----+-----+-----+-----+
|
||||
;
|
||||
; CNS - console to assign
|
||||
; Match - if not 0,
|
||||
; PD's default console must match acb_cns
|
||||
; PD Addr - PD address to assign to
|
||||
; Name - use PD name to assign, if PD addr=0
|
||||
; Name - use PD name to assign, if PD addr=1,
|
||||
; but also ensure DSKLD flag is off
|
||||
; (DiSK LoaD is set when PD was created
|
||||
; from disk transient, RSPs have DSKLD=0)
|
||||
; Should check for DSKLD=1 if PD addr = 0
|
||||
; but we may have compatibility issues
|
||||
;
|
||||
; exit: BX = 0 if success, 0ffffh if failure
|
||||
; CX = Error Code
|
||||
|
||||
push dx ;save ACB
|
||||
mov bx,offset thrd_spb ;get ownership of thread
|
||||
mov cx,f_sync
|
||||
call osif
|
||||
pop di ;U_WRKSEG:DI->ACB
|
||||
mov indisp,true ;stop dispatching
|
||||
|
||||
push ds ;save SYSDAT
|
||||
mov ds,u_wrkseg
|
||||
cmp acb_pd[di],1 ;name or address match ?
|
||||
jbe as_name
|
||||
|
||||
mov bx,acb_pd[di] ;find by PD address
|
||||
pop ds ;DS=SYSDAT
|
||||
mov si,(offset thrdrt)-p_thread
|
||||
as_next1: ;verify PD is on thread
|
||||
mov si,p_thread[si]
|
||||
test si,si ! jz as_nom ;no match if end of thread
|
||||
cmp bx,si ! je as_found_id
|
||||
jmps as_next1
|
||||
as_found_id:
|
||||
call as_chk ;check console match
|
||||
jcxz as_mok ;match ok
|
||||
jmps as_nom ;no match
|
||||
|
||||
as_name: ;look for PD by name on thread
|
||||
pop ds ;DS=SYSDAT
|
||||
mov bx,(offset thrdrt)-p_thread
|
||||
as_next2: ;look for PD by name on thread
|
||||
push di ;save ACB
|
||||
lea dx,acb_name[di] ;U_WRKSEG:DI->ACB
|
||||
mov ds,u_wrkseg ;DS:DX->ASCII name
|
||||
mov cx,f_findpdname
|
||||
call osif
|
||||
mov ds,sysdat
|
||||
pop di ;ACB
|
||||
jcxz as_okname ;CX<>0 if no match
|
||||
|
||||
as_nom:
|
||||
mov cx,e_no_pdname ;couldn't find PD specified
|
||||
jmps as_err ;by ACB on thread list
|
||||
as_okname:
|
||||
;matched PD by name check by ACB
|
||||
call as_chk ;BX->PD matched by name
|
||||
jcxz as_mok
|
||||
;console or DSKLD didn't match
|
||||
jmps as_next2 ;search for another PD
|
||||
|
||||
as_mok: ;match OK, found the PD
|
||||
push bx ! push di ;BX=matched PD, DI=ACB
|
||||
mov bx,offset thrd_spb
|
||||
mov cx,f_unsync
|
||||
call osif
|
||||
pop di ! pop ax ;DI=ACB, AX=matched PD
|
||||
mov ds,u_wrkseg
|
||||
push ax ;save matched PD
|
||||
mov al,acb_cns[di]
|
||||
mov ds,sysdat
|
||||
call getccbadr_spec ;SI=CCB on return
|
||||
mov bx,rlr ;BX=running process
|
||||
pop ax ;AX=matched PD
|
||||
|
||||
cmp c_attach[si],0 ;and change CCB
|
||||
je as_ok ;CCB must be unused (0) or
|
||||
cmp c_attach[si],bx ;running process must own it
|
||||
je as_ok
|
||||
mov cx,e_not_owner
|
||||
as_err:
|
||||
push cx ;save error code
|
||||
call as_ok_disp
|
||||
mov bx,offset thrd_spb
|
||||
mov cx,f_unsync
|
||||
call osif
|
||||
pop cx
|
||||
mov bx,0ffffh
|
||||
ret
|
||||
as_ok:
|
||||
mov c_attach[si],ax ;new owner
|
||||
push ax ! push si ;save owner and CCB
|
||||
call as_ok_disp ;allow dispatches
|
||||
pop si ! pop ax
|
||||
mov bx,ax ;AX=BX=new owner
|
||||
add si,c_queue-p_link ;go down CCB queue for PD
|
||||
mov di,si ;DI=SI=address of CCB.QUEUE
|
||||
as_nqpd:
|
||||
cmp p_link[si],0 ;look on C_QUEUE for PD being
|
||||
jz as_gexit ;assigned the console
|
||||
cmp p_link[si],bx
|
||||
je as_qfix
|
||||
mov si,p_link[si]
|
||||
jmps as_nqpd ;next PD
|
||||
as_qfix:
|
||||
mov ax,p_link[bx] ;take PD out of C_QUEUE
|
||||
mov p_link[si],ax
|
||||
mov si,p_link[di] ;SI = first PD on C_QUEUE
|
||||
mov p_link[di],bx ;put PD in front of C_QUEUE
|
||||
mov p_link[bx],si ;attach rest of list
|
||||
mov dx,di ;pass C_QUEUE address to wakeup
|
||||
mov cx,f_wakeup
|
||||
call osif
|
||||
as_gexit:
|
||||
xor bx,bx
|
||||
ret
|
||||
|
||||
as_ok_disp:
|
||||
;----------
|
||||
; entry: none
|
||||
; exit: none
|
||||
; Allow dispatching
|
||||
|
||||
mov indisp,false
|
||||
pushf ! cli
|
||||
cmp drl,0 ! je as_nwake
|
||||
mov cx,f_dispatch
|
||||
call osif
|
||||
as_nwake:
|
||||
popf ! ret
|
||||
|
||||
as_chk:
|
||||
;------
|
||||
; check PD against Assign Control Block parameters
|
||||
; entry: BX = PD to check
|
||||
; U_WRKSEG:DI = ACB
|
||||
; exit: CX = 0 if assign match
|
||||
; CX <> 0 if no match
|
||||
; CX,AX used
|
||||
|
||||
xor cx,cx
|
||||
push es ;save UDA
|
||||
mov es,u_wrkseg
|
||||
mov ax,es:acb_pd[di]
|
||||
cmp ax,1 ;if >1 then matching on PD address
|
||||
ja asc_cns
|
||||
dec ax
|
||||
jnz asc_cns
|
||||
test p_flag[bx],pf_dskld ;RSP, DSKLD must be off
|
||||
jnz asc_no
|
||||
asc_cns:
|
||||
cmp es:acb_match[di],0 ;console match requested ?
|
||||
je asc_ok
|
||||
mov al,es:acb_cns[di] ;must match on console
|
||||
cmp al,p_cns[bx]
|
||||
je asc_ok
|
||||
asc_no:
|
||||
inc cx
|
||||
asc_ok:
|
||||
pop es ;ES=UDA
|
||||
ret
|
||||
|
||||
;=============== =====================
|
||||
getdefcon_entry: ; Get Default Console
|
||||
;=============== =====================
|
||||
|
||||
mov si,rlr
|
||||
xor bh,bh ! mov bl,p_cns[si]
|
||||
ret
|
||||
|
||||
;=============== ==================
|
||||
getdeflst_entry: ; Get Default List
|
||||
;=============== ==================
|
||||
|
||||
mov si,rlr
|
||||
xor bh,bh ! mov bl,p_lst[si]
|
||||
ret
|
||||
|
||||
;=============== =====================
|
||||
setdefcon_entry: ; Set Default Console
|
||||
;=============== =====================
|
||||
|
||||
cmp dl,ncondev
|
||||
jb sd_good
|
||||
mov cx,e_ill_cns
|
||||
mov bx,0ffffh ! ret
|
||||
sd_good:
|
||||
mov si,rlr
|
||||
mov p_cns[si],dl
|
||||
call getccbadr
|
||||
mov u_conccb,si
|
||||
xor bx,bx
|
||||
ret
|
||||
|
||||
;=============== ==================
|
||||
setdeflst_entry: ; Set Default List
|
||||
;=============== ==================
|
||||
|
||||
cmp dl,nlstdev
|
||||
jb sdl_good
|
||||
mov cx,e_ill_lst
|
||||
mov bx,0ffffh ! ret
|
||||
sdl_good:
|
||||
mov si,rlr
|
||||
mov p_lst[si],dl
|
||||
call getlcbadr
|
||||
mov u_lstccb,si
|
||||
xor bx,bx
|
||||
ret
|
||||
|
||||
|
||||
getccbadr:
|
||||
;---------
|
||||
; get CCB for calling process' console device
|
||||
; input: None
|
||||
; output: SI = address of CCB
|
||||
; BX = running PD address
|
||||
|
||||
mov bx,rlr
|
||||
mov al,p_cns[bx]
|
||||
|
||||
getccbadr_spec: ;AL is console number
|
||||
xor ah,ah ;when called from ASSIGN
|
||||
mov si,ccb
|
||||
mov cl,2
|
||||
shl ax,cl
|
||||
add si,ax ;+4
|
||||
add si,ax ;+4 = 8
|
||||
add si,ax ;+4 =12
|
||||
mov cl,3
|
||||
shl ax,cl
|
||||
add si,ax ;+32 =44
|
||||
ret
|
||||
|
||||
getlcbadr:
|
||||
;---------
|
||||
; Get LCB for calling process list device
|
||||
; entry: None
|
||||
; output: SI = address of LCB
|
||||
; BX = PD address
|
||||
|
||||
mov bx,rlr
|
||||
xor ah,ah
|
||||
mov al,p_lst[bx]
|
||||
cmp al,nlst ; range check on # legal list dev's
|
||||
jbe lcb_cont
|
||||
mov al,0 ; if out of range, normalize to zero
|
||||
mov p_lst[bx],al
|
||||
lcb_cont:
|
||||
mov si,lcb
|
||||
push ax ;lcb#
|
||||
shl ax,1 ;2*lcb#
|
||||
add si,ax ;lcbadr + 2*lcb#
|
||||
pop ax ;lcb#
|
||||
mov cl,3
|
||||
shl ax,cl ;8*lcb#
|
||||
add si,ax ;lcbadr + 2*lcb# + 8*lcb#
|
||||
ret
|
||||
|
||||
|
||||
;=======
|
||||
cioterm:
|
||||
;=======
|
||||
; Detach Calling process from all character devices.
|
||||
; Called only from the dispatcher
|
||||
|
||||
mov al,ncondev
|
||||
mov si,ccb
|
||||
nxtccb: cmp al,0 ! je ct_dlcb
|
||||
cmp si,u_conccb ! jne ct_dccb
|
||||
and c_flag[si],not (cf_conout + cf_vout + cf_bufp)
|
||||
mov cx,f_wakeup ;release proc waiting for XIOS conout
|
||||
lea dx,c_cosleep[si]
|
||||
push ax ! push si
|
||||
call osif
|
||||
pop si ! pop ax
|
||||
ct_dccb:
|
||||
push ax ! push si
|
||||
call ciodetach
|
||||
pop si ! pop ax
|
||||
dec al
|
||||
add si,ccblen
|
||||
jmps nxtccb
|
||||
|
||||
ct_dlcb:
|
||||
mov al,nlstdev
|
||||
mov si,lcb
|
||||
ct_nlcb:
|
||||
cmp al,0 ! je ct_ret
|
||||
push ax ! push si
|
||||
call lst_det
|
||||
;call ciodetach
|
||||
pop si ! pop ax
|
||||
dec al
|
||||
add si,lcblen
|
||||
jmps ct_nlcb
|
||||
|
||||
ct_ret: xor bx,bx ! ret
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* BDOS Constants Area
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
xerr_list dw 0,permsg,rodmsg,rofmsg,selmsg
|
||||
dw xe5,xe6,xe7,xe8,xe9,xe10,xe11,xe3
|
||||
|
||||
LOG_FXS db 11 ;number of log_fxs entrys
|
||||
db fxi15,fxi17,fxi19,fxi22,fxi23
|
||||
db fxi30,fxi35,fxi99,fxi100,fxi102,fxi103
|
||||
db 0,0,0,0 ;reserved
|
||||
rw_fxs db 7 ;number of rw_fxs entrys
|
||||
db fxi20,fxi21,fxi33,fxi34,fxi40,fxi42,fxi43
|
||||
db 0,0 ;reserved
|
||||
sc_fxs db 2 ;number of sc_fxs entrys
|
||||
db fxi16,fxi18
|
||||
db 0,0 ;reserved
|
||||
|
||||
; number of lock list items required for lock operation
|
||||
required_table db 1,0,2,2,1,1,2,2,1,1,2,2,1,1,2,2
|
||||
|
||||
;************** end of BDOS Constants ****************
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
;*****************************************************
|
||||
;*
|
||||
;* Concurrent CP/M-86 v3.1
|
||||
;* =======================
|
||||
;*
|
||||
;* Copyright (c) 1982,1983,1984
|
||||
;*
|
||||
;* Digital Research
|
||||
;* P.O.Box 579
|
||||
;* Pacific Grove, California 93950
|
||||
;*
|
||||
;* (408) 649-3896
|
||||
;* TWX 9103605001
|
||||
;*
|
||||
;* All Information contained in this source listing is
|
||||
;*
|
||||
;* PROPRIETORY
|
||||
;* ===========
|
||||
;*
|
||||
;* All rights reserved. No part of this document
|
||||
;* may be reproduced, transmitted, stored in a
|
||||
;* retrieval system, or translated into any language
|
||||
;* or computer language, in any form or by any means
|
||||
;* without the prior written permission of Digital
|
||||
;* Research, P.O Box 579, Pacific Grove, California.
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
;*****************************************************
|
||||
;*
|
||||
;* bdos data area
|
||||
;*
|
||||
;*****************************************************
|
||||
|
||||
CCPMOFF equ true
|
||||
|
||||
DSEG
|
||||
|
||||
if CCPMOFF
|
||||
org 0800h ;org for CCP/M system
|
||||
endif
|
||||
if not CCPMOFF
|
||||
org 0C00h ;org for MP/M system
|
||||
endif
|
||||
|
||||
rlog dw 0 ;removeable logged-in disks
|
||||
tlog dw 0 ;removeable disk test login vector
|
||||
ntlog dw 0 ;new tlog vector
|
||||
rodsk dw 0 ;read only disk vector
|
||||
dlog dw 0 ;logged-in disks
|
||||
|
||||
open_fnd db 0 ;open file found in srch_olist
|
||||
|
||||
;the following variables are set to zero upon entry to file system
|
||||
|
||||
fcbdsk db 0 ;disk named in fcb
|
||||
parlg db 0 ;length of parameter block copied
|
||||
aret dw 0 ;adr value to return
|
||||
lret equ byte ptr aret ;low(aret)
|
||||
resel db 0 ;reselection flag
|
||||
rd_dir_flag db 0 ;must read/locate directory record
|
||||
comp_fcb_cks db 0 ;compute fcb checksum flag
|
||||
search_user0 db 0 ;search user 0 for file (open)
|
||||
make_xfcb db 0 ;make & search xfcb flag
|
||||
find_xfcb db 0 ;search find xfcb flag
|
||||
xdcnt dw 0 ;empty directory dcnt
|
||||
DIR_CNT DB 0 ;DIRECT I/O COUNT
|
||||
MULT_NUM DB 0 ;MULTI-SECTOR COUNT used in bdos
|
||||
olap_type db 0 ;record lock overlap type
|
||||
ff_flag db 0 ;0ffh xios error return flag
|
||||
err_type db 0 ;type of error to print if not zero
|
||||
RELOG DB 0 ;AUTOMATIC RELOG SWITCH
|
||||
; rb 3 ;reserved bytes
|
||||
;
|
||||
; **3.1M** Record locking patch
|
||||
;
|
||||
rb 1
|
||||
file_id dw 0 ;address of lock list entry
|
||||
;
|
||||
; **3.1M** End of record locking patch
|
||||
;
|
||||
zerolength equ (offset $)-(offset fcbdsk)
|
||||
mult_sec db 1 ;multi sector count passed to xios
|
||||
rb 1 ;reserved - not used 1/19/84
|
||||
|
||||
BLK_OFF DB 0 ;RECORD OFFSET WITHIN BLOCK
|
||||
blk_num dw 0 ;block number
|
||||
|
||||
ua_lroot dw offset ua0 ;unallocated block list root
|
||||
|
||||
ua0 dw offset ua1,0
|
||||
db 0ffh,0
|
||||
ua1 dw offset ua2,0
|
||||
db 0ffh,0
|
||||
ua2 dw offset ua3,0
|
||||
db 0ffh,0
|
||||
ua3 dw offset ua4,0
|
||||
db 0ffh,0
|
||||
ua4 dw offset ua5,0
|
||||
db 0ffh,0
|
||||
ua5 dw 0,0
|
||||
db 0ffh,0
|
||||
|
||||
HASH RB 4 ;HASH CODE WORK AREA
|
||||
HASHL DB 0 ;HASH SEARCH LENGTH
|
||||
|
||||
DEBLOCK_FX DB 0 ;DEBLOCK FUNCTION #
|
||||
PHY_OFF DB 0 ;RECORD OFFSET WITHIN PHYSICAL RECORD
|
||||
CUR_BCBA DW 0 ;CURRENT BCB OFFSET
|
||||
ROOT_BCBA DW 0 ;ROOT BCB OFFSET
|
||||
EMPTY_BCBA DW 0 ;EMPTY BCB OFFSET
|
||||
P_LAST_BCBA DW 0 ;PROCESS'S LAST BCB OFFSET
|
||||
P_BCB_CNT DB 0 ;PROCESS BCB COUNT IN BCB LIST
|
||||
|
||||
fx_intrn db 0 ;internal BDOS function number
|
||||
|
||||
TRACK DW 0 ;BCB RECORD'S TRACK
|
||||
SECTOR DW 0 ;BCB RECORD'S SECTOR
|
||||
|
||||
; seldsk,usrcode are initialized as a pair
|
||||
seldsk db 0 ;selected disk num
|
||||
usrcode db 0 ;curr user num
|
||||
|
||||
info dw 0 ;info adr
|
||||
searcha dw 0 ;search adr
|
||||
|
||||
;the following variable order is critical
|
||||
|
||||
;variables copied from uda for mp/m x
|
||||
|
||||
;variables included in fcb checksum for mp/m and cp/m x
|
||||
|
||||
;variables used to access system lock list for mp/m x
|
||||
|
||||
dma_ofst dw 0 ;dma offset 1
|
||||
dma_seg dw 0 ;dma segment 2
|
||||
func db 0 ;bdos function # 3
|
||||
searchl db 0 ;search len 4
|
||||
searchaofst dw 0 ;search adr ofst 5
|
||||
searchabase dw 0 ;search adr base 6
|
||||
dcnt dw 0 ;directory counter 7
|
||||
extcnt dw 0 ;extent count (used by PC/BDOS) 8
|
||||
error_mode db 0 ;bdos error mode 9
|
||||
mult_cnt db 0 ;bdos multi-sector cnt 10
|
||||
df_password rb 8 ;process default pw 11
|
||||
pd_cnt db 0 ;bdos process cnt 12 1
|
||||
high_ext db 0 ;fcb high extent bits 2
|
||||
xfcb_read_only db 0 ;xfcb read only flag 3
|
||||
curdsk db 0ffh ;current disk 4 1
|
||||
packed_dcnt db 0 ;packed dblk+dcnt 2
|
||||
db 0
|
||||
db 0
|
||||
pdaddr dw 0 ;process descriptor addr 3
|
||||
|
||||
; org ((offset $) + 1) and 0fffeh
|
||||
rb 0 ;adjust for word alignment
|
||||
|
||||
; curtrka - alloca are set upon disk select
|
||||
; (data must be adjacent)
|
||||
|
||||
cdrmaxa dw 0 ;ptr to cur dir max val
|
||||
drvlbla dw 0 ;drive label data byte addr
|
||||
buffa dw 0 ;ptr to dir dma addr
|
||||
dpbaddr dw 0 ;curr disk param block addr
|
||||
checka dw 0 ;curr checksum vector addr
|
||||
alloca dw 0 ;curr alloc vector addr
|
||||
DIR_BCBA DW 0 ;DIRECTORY BUFFER CONTROL BLOCK ADDR
|
||||
DAT_BCBA dw 0 ;DATA BUFFER CONTROL BLOCK ADDR
|
||||
HASH_SEG dw 0 ;HASH TABLE SEGMENT
|
||||
addlist equ 12 ;"$-buffa" = addr list size
|
||||
|
||||
; extended DPB parameters for PCDOS media
|
||||
; (data must be adjacent to CPM DPB)
|
||||
|
||||
nfats dw 0
|
||||
nfatrecs dw 0
|
||||
nclstrs dw 0
|
||||
clsize dw 0
|
||||
fatadd dw 0
|
||||
|
||||
; sectpt - offset obtained from disk parm block at dpbaddr
|
||||
; (data must be adjacent)
|
||||
|
||||
sectpt dw 0 ;sectors per track
|
||||
blkshf db 0 ;block shift factor
|
||||
blkmsk db 0 ;block mask
|
||||
extmsk db 0 ;extent mask
|
||||
maxall dw 0 ;max alloc num
|
||||
dirmax dw 0 ;max dir num
|
||||
dirblk dw 0 ;reserved alloc bits for dir
|
||||
chksiz dw 0 ;size of checksum vector
|
||||
offsetv dw 0 ;offset tracks at beginning
|
||||
PHYSHF DB 0 ;PHYSICAL RECORD SHIFT FACTOR
|
||||
PHYMSK DB 0 ;PHYSICAL RECORD MASK
|
||||
endlist rs 0 ;end of list
|
||||
dpblist equ (offset endlist)-(offset sectpt)
|
||||
pclist equ (offset endlist)-(offset nfats)
|
||||
|
||||
; local variables
|
||||
|
||||
pc_pre_read db 0
|
||||
db 0 ; - not used -
|
||||
media_format db 0
|
||||
|
||||
common_dma rb 16 ;copy of user's dma 1st 16 bytes
|
||||
make_flag db 0 ;make function flag
|
||||
actual_rc db 0 ;directory ext record count
|
||||
save_xfcb db 0 ;search xfcb save flag
|
||||
save_mod db 0 ;open_reel module save field
|
||||
pw_mode db 0 ;password mode
|
||||
attributes db 0 ;fcb interface attributes hold byte
|
||||
|
||||
chk_olist_flag db 0 ;check | test olist flag
|
||||
lock_sp dw 0 ;lock stack ptr
|
||||
lock_shell db 0 ;lock shell flag
|
||||
check_fcb_ret db 0 ;check_fcb return switch
|
||||
lock_unlock db 0 ;lock | unlock function flag
|
||||
incr_pdcnt db 0 ;increment process_cnt flag ??
|
||||
free_mode db 0 ;free lock list entries flag ??
|
||||
;1=free entries for curdsk
|
||||
;0=free all entries
|
||||
cur_pos dw 0 ;current position in lock list
|
||||
prv_pos dw 0 ;previous position in lock list
|
||||
|
||||
dont_close db 0 ;inhibit actual close flag
|
||||
open_cnt db 0 ;process open file count
|
||||
lock_cnt db 0 ;process locked record count
|
||||
;
|
||||
; **3.1M** Record locking patch
|
||||
;
|
||||
;file_id dw 0 ;address of file' lock list entry
|
||||
name_root dw 0 ;root of file names and id's
|
||||
;
|
||||
; **3.1M** End of record lcoking patch
|
||||
;
|
||||
set_ro_flag db 0 ;set drive r/o flag
|
||||
check_disk db 0 ;disk reset open file check flag
|
||||
flushed db 0 ;lock list open file flush flag
|
||||
|
||||
; free_root, lock_max, open_max initialized by sysgen
|
||||
|
||||
dw offset free_root
|
||||
open_root dw 0 ;lock list open file list root
|
||||
lock_root dw 0 ;lock list locked record list root
|
||||
|
||||
sdcnt dw 0 ;saved dcnt of file's 1st fcb
|
||||
sdcnt0 dw 0 ;saved dcnt (user 0 pass)
|
||||
|
||||
rmf db 0 ;read mode flag for open$reel
|
||||
wflag db 0 ;xios/bios write flag
|
||||
dirloc db 0 ;directory flag in rename, etc.
|
||||
linfo db 0 ;low(info)
|
||||
dminx db 0 ;local for diskwrite
|
||||
single db 0 ;set true if single byte
|
||||
;alloc map
|
||||
rcount db 0 ;record count in curr fcb
|
||||
extval db 0 ;extent num and extmsk
|
||||
vrecord db 0 ;curr virtual record
|
||||
ADRIVE DB 0 ;CURRENT DISK - must preceed arecord
|
||||
arecord dw 0 ;curr actual record
|
||||
db 0 ;curr actual record high byte
|
||||
ARECORD1 dw 0 ;curr actual block# * blkmsk
|
||||
drec dw 0 ;curr actual directory record
|
||||
CUR_dma_seg DW 0
|
||||
CUR_DMA DW 0
|
||||
|
||||
; local variables for directory access
|
||||
|
||||
dptr db 0 ;directory pointer 0,1,2,3
|
||||
ldcnt equ byte ptr dcnt ;low(dcnt)
|
||||
user_zero_pass db 0 ;search user zero flag
|
||||
|
||||
; shell variables
|
||||
|
||||
shell_si dw 0 ;bdos command offset
|
||||
shell_rr db 0,0,0 ;r0,r1,r2 save area
|
||||
|
||||
; special 8086 variables:
|
||||
|
||||
uda_save dw 0 ;user data area saved value
|
||||
parametersegment dw 0 ;user parameter segment
|
||||
returnseg dw 0 ;user return segment
|
||||
|
||||
; error messages
|
||||
|
||||
err_drv db 0
|
||||
err_pd_addr dw 0
|
||||
|
||||
dskmsg db 13,10,'CP/M Error On '
|
||||
dskerr db ' : ',0
|
||||
|
||||
permsg db 'Disk I/O',0
|
||||
rodmsg db 'Read/Only Disk',0
|
||||
rofmsg db 'Read/Only File',0
|
||||
selmsg db 'Invalid Drive',0
|
||||
|
||||
xe3 db 'File Opened in Read/Only Mode',0
|
||||
|
||||
xe5 db 'File Currently Open',0
|
||||
xe6 db 'Close Checksum Error',0
|
||||
xe7 db 'Password Error',0
|
||||
xe8 db 'File Already Exists',0
|
||||
xe9 db 'Illegal ? in FCB',0
|
||||
xe10 db 'Open File Limit Exceeded',0
|
||||
xe11 db 'No Room in System Lock List',0
|
||||
|
||||
crlf_str db 13,10,0
|
||||
pr_fx db 13,10,'Bdos Function = '
|
||||
pr_fx1 db ' '
|
||||
pr_fcb db ' File = '
|
||||
pr_fcb1 rs 12
|
||||
db 0
|
||||
|
||||
deniedmsg db 13,10,'Disk reset denied, Drive '
|
||||
denieddrv db 0,':'
|
||||
db ' Console '
|
||||
deniedcns db 0
|
||||
db ' Program '
|
||||
deniedprc db '12345678',0
|
||||
|
||||
; bdos stack switch variables and stack
|
||||
; used for all bdos disk functions
|
||||
|
||||
; org ((offset $) + 1) and 0fffeh
|
||||
rb 1 ;adjust for word alignment
|
||||
|
||||
; 69 word bdos stack
|
||||
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
dw 0cccch,0cccch,0cccch
|
||||
bdosstack rw 0
|
||||
|
||||
save_sp rw 1
|
||||
ss_save rw 1
|
||||
sp_save rw 1
|
||||
|
||||
; local buffer area:
|
||||
|
||||
info_fcb rb 40 ;local user FCB
|
||||
save_fcb rb 16 ;fcb save area for xfcb search
|
||||
|
||||
mxdiskqd dw 0 ;link
|
||||
db 0,0 ;net,org
|
||||
dw qf_keep+qf_mx ;flags (MX queue)
|
||||
db 'MXdisk '
|
||||
dw 0,1 ;msglen,nmsgs
|
||||
dw 0,0 ;nq,dq
|
||||
dw 1,0 ;msgcnt,out
|
||||
dw 0 ;buffer ptr
|
||||
|
||||
mxdiskqpb db 0 ;flgs
|
||||
db 0 ;net
|
||||
dw mxdiskqd ;qaddr
|
||||
dw 1 ;nmsgs
|
||||
dw 0 ;buffer
|
||||
db 'MXdisk '
|
||||
|
||||
; Error Message sync param block for mutual exclusion
|
||||
|
||||
msg_spb dw 0 ;link Error Message sync parameter block
|
||||
dw 0 ;owner
|
||||
dw 0 ;wait
|
||||
dw 0 ;next
|
||||
|
||||
; local variables used by PC_BDOS
|
||||
|
||||
bdrwflg db 0 ;bdosrw flags
|
||||
blk dw 0 ;bdosrw local variable
|
||||
blkcnt dw 0 ;bdosrw local variable
|
||||
blkidx dw 0 ;bdosrw local variable
|
||||
blkoffset dw 0 ;bdosrw local variable
|
||||
cpm_tod db 0,0,0,0,0 ;CP/M date work area
|
||||
dirp dw 0 ;directory entry pointer
|
||||
lprvblk dw 0 ;bdosrw local variable
|
||||
|
||||
mon_days dw 0,31,59,90,120,151,181,212,243,273,304,334
|
||||
|
||||
byteoff dw 0 ;bdosrw local variable
|
||||
dw 0
|
||||
pc_tod db 0,0,0,0,0,0 ;PC date work area
|
||||
preread db 0 ;bdosrw local variable
|
||||
prvblk dw 0 ;bdosrw local variable
|
||||
|
||||
update_rc db 0 ;recompute rc flag
|
||||
pc_module db 0 ;bdosrw module save byte
|
||||
pc_ext db 0 ;bdosrw extent save byte
|
||||
pc_cr db 0 ;bdosrw current record save byte
|
||||
|
||||
; local variables used by PC_BDOS direct disk I/O module
|
||||
|
||||
ddio_op db 0 ;type of operation read/write
|
||||
ddio_drive db 0 ;drive number
|
||||
ddio_nsectors db 0 ;number of sectors to transfer
|
||||
ddio_head db 0 ;head number for INT 13
|
||||
ddio_startrec rw 0 ;starting sector number
|
||||
;startrec overlays sector and track
|
||||
ddio_sector db 0 ;sector number for INT 13
|
||||
ddio_track db 0 ;track number for INT 13
|
||||
ddio_dmaoff dw 0 ;DMA offset
|
||||
ddio_dmaseg dw 0 ;DMA segment
|
||||
ddio_pblen equ offset $ - offset ddio_op
|
||||
|
||||
;ddio_pd_vector dw 0,0,0,0,0,0,0,0
|
||||
; dw 0,0,0,0,0,0,0,0
|
||||
|
||||
if CCPMOFF
|
||||
org 0bffh
|
||||
endif
|
||||
if not CCPMOFF
|
||||
org 0fffh
|
||||
endif
|
||||
db 0
|
||||
| ||||