Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -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


View File

@@ -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

View File

@@ -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 ****************


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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 ****************


View File

@@ -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.
;*
;*****************************************************


View File

@@ -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


View File

@@ -0,0 +1,16 @@
;*****************************************************
;*
;* System Entry Table entry format
;*
;*****************************************************
enttab_entry equ word ptr 0
entlen equ enttab_entry + word
; Flags Values in ent_flag
ef_network equ 0f0h ; network intercept
; see SYSTEM.DEF for ent_tab definition


View File

@@ -0,0 +1,56 @@
; BDOS symbols:
on EQU 0ffffh
off EQU 00000h
; Special 8086 symbols:
b equ byte ptr 0
w equ word ptr 0
; literal constants
enddir EQU 0ffffh ;end of directory
; file control block (fcb) constants
fcblen EQU 32 ;fcb length
empty EQU 0e5h ;empty directory entry
lstrec EQU 127 ;last record# in extent
recsiz EQU 128 ;record size
dirrec EQU recsiz/fcblen ;directory elts / record
dskshf EQU 2 ;log2(dirrec)
dskmsk EQU dirrec-1
fcbshf EQU 5 ;log2(fcblen)
maxext EQU 31 ;largest extent number
maxmod EQU 63 ;largest module number
fwfmsk EQU 80h ;file write flag is high
;order modnum
namlen EQU 15 ;name length
;lstfcb EQU fcblen-1
drv EQU 0 ;drive field
f1 EQU 1 ;file name byte 1 to 8
;f2 EQU 2
;f3 EQU 3
;f4 EQU 4
f5 EQU 5
;f6 EQU 6
f7 EQU 7
f8 EQU 8
; reserved file indicators
rofile EQU 9 ;t1' -> read/only file
sysfil EQU 10 ;t2' -> system file
ARCHIV EQU 11 ;t3' -> FILE HAS BEEN ARCHIVED
extnum EQU 12 ;extent number field
chksum EQU 13 ;unfilled bytes field
modnum EQU 14 ;data module number
reccnt EQU 15 ;record count field
dskmap EQU 16 ;disk map field
nxtrec EQU fcblen
ranrec EQU nxtrec+1 ;random record field (3 bytes)


View File

@@ -0,0 +1,49 @@
;*****************************************************
;*
;* Error definitions
;*
;*****************************************************
e_not_implemented equ 1 ; not implemented
e_bad_entry equ 2 ; illegal func. #
e_no_memory equ 3 ; cant find memory
e_ill_flag equ 4 ; illegal flag #
e_flag_ovrrun equ 5 ; flag over run in
e_flag_underrun equ 6 ; flag underrun in
e_no_qd equ 7 ; no unused qd's
e_no_qbuf equ 8 ; no free qbuffer
e_no_queue equ 9 ; cant find que on qlr
e_q_inuse equ 10 ; queue in use
; equ 11 ;
e_no_pd equ 12 ; no free pd's
e_q_protected equ 13 ; no que access
e_q_empty equ 14 ; empty queue
e_q_full equ 15 ; full queue
e_ncliq equ 16 ; Cli queue missing
e_nondp equ 17 ; no NDP present in system
e_no_umd equ 18 ; no unused MD's
e_ill_cns equ 19 ; illegal cns num.
e_no_pdname equ 20 ; no PD match
e_no_cnsmatch equ 21 ; no cns match
e_nclip equ 22 ; no cli process
e_illdisk equ 23 ; illegal disk #
e_badfname equ 24 ; illegal filename
e_badftype equ 25 ; illegal filetype
e_nochar equ 26 ; char not ready
e_ill_md equ 27 ; illegal mem descriptor
e_bad_load equ 28 ; bad ret. from BDOS load
e_bad_read equ 29 ; bad ret. from BDOS read
e_bad_open equ 30 ; bad ret. from BDOS open
e_nullcmd equ 31 ; null command
e_not_owner equ 32 ; not owner of resource
e_no_cseg equ 33 ; no CSEG in load file
e_active_pd equ 34 ; PD exists on Thread Root
e_pd_noterm equ 35 ; could not terminate process
e_no_attach equ 36 ; could not attach to ciodev
e_ill_lst equ 37 ; illegal list device
e_ill_passwd equ 38 ; illegal password specified
e_no_mimic equ 39 ; can't mimic or unmimic
e_abort equ 40 ; external termination occured
e_fixuprec equ 41 ; fixup error
e_flag_ignr equ 42 ; flag set ignored


View File

@@ -0,0 +1,17 @@
;*****************************************************
;*
;* File Control Block Format
;*
;*****************************************************
fcb_dr equ byte ptr 00h
fcb_name equ byte ptr 01h
fcb_type equ byte ptr 09h
fcb_pwd equ byte ptr 010h
fcb_pptr equ word ptr 018h
fcb_plen equ byte ptr 01ah
fcb_cr equ byte ptr 020h
fcb_r0 equ word ptr 021h


File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
;*****************************************************
;*
;* Format of Flag Table Entry
;*
;*****************************************************
flg_pd equ word ptr 0
flg_ignore equ byte ptr (flg_pd + word)
flglen equ flg_ignore + byte
flag_off equ 0ffffh ;flag not set
flag_on equ 0fffeh ;flag set
flag_zig equ 0ffh ;normal value


View File

@@ -0,0 +1,18 @@
;*****************************************************
;*
;* Format of Load Table Used by Load Program
;*
;*****************************************************
ldt_start equ word ptr 0
ldt_min equ word ptr ldt_start + word
ldt_max equ word ptr ldt_min + word
ldt_pd equ word ptr ldt_max + word
ldt_atr equ word ptr ldt_pd + word
ldt_fstrt equ word ptr ldt_atr + word
ldt_flen equ word ptr ldt_fstrt + word
ldt_type equ byte ptr ldt_flen + word
ldt_id equ word ptr ldt_type + byte
ldtlen equ ldt_id + word


View File

@@ -0,0 +1,31 @@
;*****************************************************
;*
;* Memory Descriptor Formats
;*
;*****************************************************
; format while on MFL or MAL
m_link equ word ptr 0
m_start equ word ptr m_link+word
m_length equ word ptr m_start+word
m_plist equ word ptr m_length+word
m_unused equ word ptr m_plist+word
mdlen equ m_unused+word
; format while on PD as memory segment
; ms_flags uses same definitions as
; mpb_flags
ms_link equ word ptr m_link
ms_start equ word ptr m_start
ms_length equ word ptr m_length
ms_flags equ word ptr m_plist
ms_mau equ word ptr m_unused
; format of spb (share parameter block)
spb_opd equ word ptr 0
spb_rpd equ word ptr spb_opd + word
spb_start equ word ptr spb_rpd + word


View File

@@ -0,0 +1,165 @@
;*****************************************************
;*
;* CCP/M-86, MP/M-86 Inter-Module Function Definitions
;*
;* Same calling conventions as User programs
;* except CX = function instead of CL
;* BX = 2nd parameter on entry
;* (CH=module, CL=function # in module)
;*
;*****************************************************
; Module definitions
user equ 0
sup equ 1
rtm equ 2
mem equ 3
cio equ 4
bdos equ 5
xios equ 6
net equ 7
; Bits that represent present modules
; in module_map
supmod_bit equ 001h
rtmmod_bit equ 002h
memmod_bit equ 004h
bdosmod_bit equ 008h
ciomod_bit equ 010h
xiosmod_bit equ 020h
netmod_bit equ 040h
; Network Definitions
net_bit equ 080h ;network bit in func tble entry
; Supervisor Functions
;f_sysreset equ (user * 0100h) + 0
;f_conin equ (user * 0100h) + 1
f_conout equ (user * 0100h) + 2
;f_rconin equ (user * 0100h) + 3 ;supported internally
;f_rconout equ (user * 0100h) + 4 ;under CCP/M
f_lstout equ (user * 0100h) + 5
;f_rawconio equ (user * 0100h) + 6
;f_getiobyte equ (user * 0100h) + 7
;f_setiobyte equ (user * 0100h) + 8
f_conwrite equ (user * 0100h) + 9
f_conread equ (user * 0100h) + 10
;f_constat equ (user * 0100h) + 11
;f_bdosversion equ (user * 0100h) + 12
;f_diskreset equ (user * 0100h) + 13
;f_diskselect equ (user * 0100h) + 14
f_fopen equ (user * 0100h) + 15
f_fclose equ (user * 0100h) + 16
;f_searchfirst equ (user * 0100h) + 17
;f_searchnext equ (user * 0100h) + 18
;f_fdelete equ (user * 0100h) + 19
f_freadseq equ (user * 0100h) + 20
;f_fwriteseq equ (user * 0100h) + 21
;f_fmake equ (user * 0100h) + 22
;f_frename equ (user * 0100h) + 23
;f_loginvector equ (user * 0100h) + 24
f_getdefdisk equ (user * 0100h) + 25
f_setdma equ (user * 0100h) + 26
;f_getallocvec equ (user * 0100h) + 27
;f_writeprotect equ (user * 0100h) + 28
;f_getrovector equ (user * 0100h) + 29
;f_setfileattr equ (user * 0100h) + 30
;f_getdpb equ (user * 0100h) + 31
f_usercode equ (user * 0100h) + 32
f_freadrdm equ (user * 0100h) + 33
;f_fwriterdm equ (user * 0100h) + 34
;f_filesize equ (user * 0100h) + 35
f_setrndrec equ (user * 0100h) + 36
;f_resetdrive equ (user * 0100h) + 37
;f_accessdrive equ (user * 0100h) + 38
;f_freedrive equ (user * 0100h) + 39
;f_writerndzero equ (user * 0100h) + 40
;f_chain equ (user * 0100h) + 47
f_callbios equ (user * 0100h) + 50
f_setdmab equ (user * 0100h) + 51
;f_getdma equ (user * 0100h) + 52
;f_getmaxmem equ (user * 0100h) + 53
;f_getabsmaxmem equ (user * 0100h) + 54
;f_allocmem equ (user * 0100h) + 55
;f_allocabsmem equ (user * 0100h) + 56
f_freemem equ (user * 0100h) + 57
f_freeall equ (user * 0100h) + 58
;f_userload equ (user * 0100h) + 59
f_delim equ (user * 0100h) + 110
f_malloc equ (user * 0100h) + 128
f_memfree equ (user * 0100h) + 130
;f_polldev equ (user * 0100h) + 131
f_flagwait equ (user * 0100h) + 132
f_flagset equ (user * 0100h) + 133
f_qmake equ (user * 0100h) + 134
f_qopen equ (user * 0100h) + 135
;f_qdelete equ (user * 0100h) + 136
f_qread equ (user * 0100h) + 137
f_cqread equ (user * 0100h) + 138
f_qwrite equ (user * 0100h) + 139
f_cqwrite equ (user * 0100h) + 140
;f_delay equ (user * 0100h) + 141
f_dispatch equ (user * 0100h) + 142
f_terminate equ (user * 0100h) + 143
f_createproc equ (user * 0100h) + 144
f_setprior equ (user * 0100h) + 145
f_conattach equ (user * 0100h) + 146
f_condetach equ (user * 0100h) + 147
;f_setdefcon equ (user * 0100h) + 148
f_conassign equ (user * 0100h) + 149
;f_clicmd equ (user * 0100h) + 150
;f_callrsp equ (user * 0100h) + 151
f_parsefilename equ (user * 0100h) + 152
;f_getdefcon equ (user * 0100h) + 153
;f_sdataddr equ (user * 0100h) + 154
;f_timeofday equ (user * 0100h) + 155
;f_pdaddress equ (user * 0100h) + 156
;f_abortprocess equ (user * 0100h) + 157
f_lstattach equ (user * 0100h) + 158
f_lstdetach equ (user * 0100h) + 159
;f_setdeflst equ (user * 0100h) + 160
;f_clstattch equ (user * 0100h) + 161
f_cconattch equ (user * 0100h) + 162
;f_osvernum equ (user * 0100h) + 163
;f_getdeflst equ (user * 0100h) + 164
; Internal SUP functions
f_load equ (sup * 0100h) + 10
f_cload equ (sup * 0100h) + 14
; Internal RTM functions
f_inflagset equ (rtm * 0100h) + 3
f_sleep equ (rtm * 0100h) + 18
f_wakeup equ (rtm * 0100h) + 19
f_findpdname equ (rtm * 0100h) + 20
f_sync equ (rtm * 0100h) + 21
f_unsync equ (rtm * 0100h) + 22
f_no_abort equ (rtm * 0100h) + 23
f_ok_abort equ (rtm * 0100h) + 24
f_no_abort_spec equ (rtm * 0100h) + 25
; Internal MEM functions
f_share equ (mem * 0100h) + 8
f_maualloc equ (mem * 0100h) + 9
f_maufree equ (mem * 0100h) + 10
f_mlalloc equ (mem * 0100h) + 11
f_mlfree equ (mem * 0100h) + 12
; Internal CIO functions
f_conprint equ (cio * 0100h) + 14
f_cioterm equ (cio * 0100h) + 23
f_ciostat equ (cio * 0100h) + 24
f_rconin equ (cio * 0100h) + 2
f_rconout equ (cio * 0100h) + 3
; Internal BDOS functions
f_bdosterm equ (bdos * 0100h) + 46
; Internal Network Functions
f_netterm equ 078Fh


View File

@@ -0,0 +1,11 @@
;*****************************************************
;*
;* Definition of Module Table Entry
;*
;*****************************************************
mod_entry equ 0
mod_init equ mod_entry + dword
modlen equ mod_init + dword


View File

@@ -0,0 +1,50 @@
;*****************************************************
;*
;* Memory Parameter Block
;*
;*****************************************************
mpb_start equ word ptr 0
mpb_min equ word ptr mpb_start + word
mpb_max equ word ptr mpb_min + word
mpb_pdadr equ word ptr mpb_max + word
mpb_flags equ word ptr mpb_pdadr + word
mpblen equ mpb_flags + word
; mpb_flags definition (also ms_flags)
mf_load equ 00001h
mf_share equ 00002h
mf_code equ 00004h
; mf_data equ 00008h
; mf_extra equ 00010h
; mf_stack equ 00020h
mf_udaonly equ 00040h
;*****************************************************
;*
;* Memory Free Parameter Block
;*
;*****************************************************
mfpb_start equ word ptr 0
mfpb_pd equ word ptr mfpb_start + word
mfpblen equ mfpb_pd + word
;*****************************************************
;*
;* MAU Free Request
;*
;* +----+----+----+----+----+----+
;* | mau | sat | start |
;* +----+----+----+----+----+----+
;*
;*****************************************************
maf_mau equ word ptr 0
maf_sat equ word ptr maf_mau + word
maf_start equ word ptr maf_sat + word
maflen equ maf_start + word


View File

@@ -0,0 +1,11 @@
;*****************************************************
;*
;* Parse Control Block
;*
;*****************************************************
pcb_flnmptr equ word ptr 0 ; name ptr
pcb_fcbptr equ word ptr pcb_flnmptr + word ; fcb ptr
pcblen equ pcb_fcbptr + word


View File

@@ -0,0 +1,132 @@
;*****************************************************
;*
;* Process Descriptor - with the UDA associated
;* with the PD, describes the current
;* state of a Process under MP/M-CCP/M
;*
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 00| link | thread |stat |prior| flag |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 08| Name |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 10| uda | dsk | user| ldsk|luser| mem |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 18| cmod|tkcnt| wait | org | net | parent |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 20| cns |abort| conmode | lst | | sflag |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;* 28| userdisp | pret | scratch |
;* +-----+-----+-----+-----+-----+-----+-----+-----+
;*
;* link - Used for placement into System Lists
;* thread - link field for Thread List
;* stat - Current Process activity
;* prior - priority
;* flag - process state flags
;* name - name of process
;* uda - Segment Address of User Data Area
;* dsk - Current default disk
;* user - Current default user number
;* ldsk - Disk program loaded from
;* luser - User number loaded from
;* mem - pointer to MD list of memory owned
;* by this process
;* cmod - compatibility mode bits.
;* 80 -> F1 bit
;* 40 -> F2 bit
;* 20 -> F3 bit
;* 10 -> F4 bit
;* tkcnt - temp keep count, # times tempkeep has been
;* turned on
;* wait - parameter field while on System Lists
;* org - Network node that originated this process
;* net - Network node running this process
;* parent - process that created this process
;* cns - default console #
;* abort - abort code
;* lst - default list #
;* sflag - more flags
;* conmode - console mode for function 109
;* reserved- not currently used
;* userdisp- user dispatch swap
;* pret - return code at termination
;* scratch - scratch word
;*
;*****************************************************
p_link equ word ptr 0
p_thread equ word ptr p_link + word
p_stat equ byte ptr p_thread + word
p_prior equ byte ptr p_stat + byte
p_flag equ word ptr p_prior + byte
p_name equ byte ptr p_flag + word
p_uda equ word ptr p_name + pnamsiz
p_dsk equ byte ptr p_uda + word
p_user equ byte ptr p_dsk + byte
p_ldsk equ byte ptr p_user + byte
p_luser equ byte ptr p_ldsk + byte
p_mem equ word ptr p_luser + byte
p_cmod equ byte ptr p_mem + word
p_tkcnt equ byte ptr p_cmod + byte
p_wait equ word ptr p_tkcnt + byte
p_parent equ word ptr p_wait + 4
p_cns equ byte ptr p_parent + word
p_abort equ byte ptr p_cns + byte
p_conmode equ word ptr p_abort + byte
p_lst equ byte ptr p_conmode + word
p_sflag equ word ptr p_lst + 2
p_userdisp equ dword ptr p_sflag + word
p_pret equ word ptr p_userdisp + 4
p_scratch equ byte ptr p_pret + word
p_wscrtch equ word ptr p_scratch
;
; Process descriptor pd_status values
;
ps_run equ 0 ; in ready list root
ps_poll equ 1 ; in poll list
ps_delay equ 2 ; in delay list
ps_swap equ 3 ; in swap list
ps_term equ 4 ; terminating
ps_sleep equ 5 ; sleep processing
ps_dq equ 6 ; in dq list
ps_nq equ 7 ; in nq list
ps_flagwait equ 8 ; in flag table
ps_ciowait equ 9 ; waiting for character
ps_sync equ 10 ; waiting for sync structure
;
; Process descriptor pd_flag bit values
;
pf_sys equ 00001h ; system process
pf_keep equ 00002h ; do not terminate
pf_kernal equ 00004h ; resident in kernal
pf_pure equ 00008h ; pure memory described
pf_table equ 00010h ; from pd table
pf_resource equ 00020h ; waiting for resource
pf_raw equ 00040h ; raw console i/o
pf_ctlc equ 00080h ; abort pending
pf_active equ 00100h ; active tty
pf_tempkeep equ 00200h ; don't terminate yet...
pf_ctld equ 00400h ; explicit detach occured
pf_childabort equ 00800h ; child terminated abnormally
pf_noctls equ 01000h ; control S not allowed
pf_dskld equ 02000h ; process was loaded from disk
pf_nokbd equ 04000h ; ignore keyboard
pf_8087 equ 08000h ; process uses 8087
;
; Process descriptor pcm_flag bit values
; (console mode set by function 109)
;
pcm_11 equ 00001h ; control C status for function 11
pcm_ctls equ 00002h ; disable control S-Q
pcm_rout equ 00004h ; raw output, no tabs or control P
pcm_ctlc equ 00008h ; disable control C
;pcm_rsrv equ 00040h ; used by CP/M 3.0
pcm_ctlo equ 00080h ; disable control O
pcm_rsx equ 00300h ; 2 bits used by RSX for status
;
; Second Flag Values
psf_suspend equ 00001h ; suspend if in background
psf_em87 equ 00002h ; using 8087 emulator


View File

@@ -0,0 +1,83 @@
;*****************************************************
;*
;* Queue Descriptor - This is structure is used
;* to create a queue. One is maintained
;* in the system data area for each queue
;*
;* +----+----+----+----+----+----+----+----+
;* 00 | link |net |org | flags | name...
;* +----+----+----+----+----+----+----+----+
;* 08 ...name | msglen |
;* +----+----+----+----+----+----+----+----+
;* 10 | nmsgs | dq | nq | msgcnt |
;* +----+----+----+----+----+----+----+----+
;* 18 | msgout | buffer |
;* +----+----+----+----+
;*
;* link - used to link QDs is system lists
;* net - which machine in the network
;* org - origin machine in the network
;* flags - Queue Flags
;* name - Name of Queue
;* msglen - # of bytes in one message
;* nmsgs - maximum # of messages in queue
;* dq - Root of PDs waiting to read
;* nq - Root of PDs list waiting to write
;* msgcnt - # of messages currently in queue
;* msgout - next message # to read
;* buf - pointer to queue message buffer
;* (for MX queues, owner of queue)
;*
;*****************************************************
q_link equ word ptr 0
q_net equ byte ptr q_link + word
q_org equ byte ptr q_net + byte
q_flags equ word ptr q_org + byte
q_name equ byte ptr q_flags + word
q_msglen equ word ptr q_name + qnamsiz
q_nmsgs equ word ptr q_msglen + word
q_dq equ word ptr q_nmsgs + word
q_nq equ word ptr q_dq + word
q_msgcnt equ word ptr q_nq + word
q_msgout equ word ptr q_msgcnt + word
q_buf equ word ptr q_msgout + word
qdlen equ q_buf + word
;
; Q_FLAGS values
;
qf_mx equ 001h ; Mutual Exclusion
qf_keep equ 002h ; NO DELETE
qf_hide equ 004h ; Not User writable
qf_rsp equ 008h ; rsp queue
qf_table equ 010h ; from qd table
qf_rpl equ 020h ; rpl queue
qf_dev equ 040h ; device queue
;*****************************************************
;*
;* QPB - Queue Parameter Block
;*
;* +----+----+----+----+----+----+----+----+
;* 00 |flgs|net | qaddr | nmsgs | buffptr |
;* +----+----+----+----+----+----+----+----+
;* 08 | name |
;* +----+----+----+----+----+----+----+----+
;*
;* flgs - unused
;* net - unused (which machine to use)
;* qaddr - Queue ID, address of QD
;* nmsgs - number of messages to read/write
;* buffptr - address to read/write into/from
;* name - name of queue (for open only)
;*
;*****************************************************
qpb_flgs equ byte ptr 0
qpb_net equ byte ptr qpb_flgs + byte
qpb_qaddr equ word ptr qpb_net + byte
qpb_nmsgs equ word ptr qpb_qaddr + word
qpb_buffptr equ word ptr qpb_nmsgs + word
qpb_name equ byte ptr qpb_buffptr + word
qpblen equ qpb_name + qnamsiz


View File

@@ -0,0 +1,50 @@
;*****************************************************
;*
;* RSP.DEF - Describes the relative offsets of
;* data items in the Data Segment of a
;* Resident System Process. GENSYS
;* links all RSP's together through the
;* rsp_link field (segment address ptrs).
;* Each RSP is started up as System
;* Initialization.
;*
;* Format: +---+---+---+---+---+---+---+---+
;* 00 | link |sdatvar|ncp| reserved |
;* +---+---+---+---+---+---+---+---+
;* 08 | reserved | CS |reserve|
;* +---+---+---+---+---+---+---+---+
;* 10 | Process Descriptor |
;* +---+---+---+---+---+---+---+---+
;* 40 | User Data Area |
;* +---+---+---+---+---+---+---+---+
;* E0 | RSP data area |
;* +---+---+---+---+---+---+---+---+
;*
;* link - GENSYS links all RSP's through this.
;* At system init, this value is filled
;* with the SYSDAT segment address
;* sdatvar - if non-zero, this is a variable address
;* in the SYSDAT area which indicates the
;* a value to put into ncopies (ncp).
;* ncp - Number of copies - Used by GENSYS to determine
;* how many copies of this RSP to generate.
;* This number is modified to be the specific
;* copy that was generated.
;* CS - Used by GENSYS to determine where a shared
;* code segment may exist in multiple copy
;* RSPs.
;*
;*****************************************************
rsp_top equ 0
rsp_link equ word ptr rsp_top
rsp_sysdat equ rsp_link
rsp_sdatvar equ word ptr rsp_link + word
rsp_ncopies equ byte ptr rsp_sdatvar + word
rsp_reserved equ rsp_ncopies + byte
rsp_md equ 08h
rsp_pd equ 10h
rsp_uda equ ((rsp_pd+pdlen+0fh)/10h)*10h
rsp_bottom equ rsp_uda + ulen


View File

@@ -0,0 +1,12 @@
;********************************************************
; *
; Sync Parameter Block *
; *
;********************************************************
sy_link equ word ptr 0
sy_owner equ word ptr sy_link + 2
sy_wait equ word ptr sy_owner + 2
sy_next equ word ptr sy_wait + 2
synclen equ sy_next + 2


View File

@@ -0,0 +1,82 @@
;*****************************************************
;*
;* bdos data area
;*
;*****************************************************
; SYTEM DATA EQUATES
SUPMOD equ ds:word ptr .000h
XIOSMOD equ ds:word ptr .028h
FREE_ROOT equ ds:word ptr .052h
RLR equ ds:word ptr .068h
TOD equ ds:byte ptr .07Eh
open_vector equ ds:word ptr .088h
LOCK_MAX equ ds:byte ptr .08Ah
OPEN_MAX equ ds:byte ptr .08Bh
err_intercept equ ds:word ptr .092h
media_flag equ ds:byte ptr .0C0Eh
DSEG
if PCMODE
PUBLIC arecord
PUBLIC attributes
PUBLIC bdrwflg
PUBLIC blk
PUBLIC blkcnt
PUBLIC blkidx
PUBLIC blkoffset
PUBLIC byteoff
PUBLIC check_fcb_ret
PUBLIC chksiz
PUBLIC cdrmaxa
PUBLIC clsize
PUBLIC common_dma
PUBLIC comp_fcb_cks
PUBLIC cpm_tod
PUBLIC dirmax
PUBLIC dir_cnt
PUBLIC dcnt
PUBLIC dirp
PUBLIC dma_ofst
PUBLIC dma_seg
PUBLIC dont_close
PUBLIC extcnt
PUBLIC fx_intrn
PUBLIC hash_seg
PUBLIC high_ext
PUBLIC info
PUBLIC info_fcb
PUBLIC lock_shell
PUBLIC lprvblk
PUBLIC lret
PUBLIC make_flag
PUBLIC mon_days
PUBLIC mult_cnt
PUBLIC mult_num
PUBLIC nclstrs
PUBLIC parlg
PUBLIC pc_cr
PUBLIC pc_ext
PUBLIC pc_module
PUBLIC pc_tod
PUBLIC phymsk
PUBLIC physhf
PUBLIC preread
PUBLIC prvblk
PUBLIC rd_dir_flag
PUBLIC sdcnt
PUBLIC searchl
PUBLIC update_rc
PUBLIC usrcode
PUBLIC ddio_op
PUBLIC ddio_drive
PUBLIC ddio_startrec
PUBLIC ddio_nsectors
PUBLIC ddio_dmaoff
PUBLIC ddio_dmaseg
endif

View File

@@ -0,0 +1,35 @@
;*****************************************************
;*
;* SYSTEM DEFINITIONS
;*
;*****************************************************
true equ 0ffffh ; value of TRUE
false equ 0 ; value of FALSE
unknown equ 0 ; value to be filled in
dskrecl equ 128 ; log. disk record len
fcblen equ 32 ; size of file control block
pnamsiz equ 8 ; size of process name
qnamsiz equ pnamsiz ; size of queue name
fnamsiz equ pnamsiz ; size of file name
ftypsiz equ 3 ; size of file type
osint equ 224 ; int vec for O.S. entry
debugint equ osint+1 ; int vec for debuggers
ulen equ 0100h ; size of uda
u8087len equ ulen + 96 ; size of uda when process uses 8087
em87len equ ulen + 64 ; size of uda when process uses 8087 emulator
pdlen equ 030h ; size of Process Descriptor
todlen equ 5 ; size of Time of Day struct
flag_tick equ 1 ; flag 0 = tick flag
flag_sec equ 2 ; flag 1 = second flag
flag_min equ 3 ; flag 2 = minute flag
ldtabsiz equ 0aah ; ldtablen=11, 10 entries
mpm equ true ; MP/M-86 or
ccpm equ not mpm ; CCP/M-86
BCPM equ false ; CP/M-86 BDOS
BMPM equ not BCPM ; multi-process BDOS
netversion equ true ; includes network changes


View File

@@ -0,0 +1,10 @@
; UDA offsets
;
ud_insys equ 60H
controlw equ 03ffh ; post-init 8087 state
user_save equ 0h ; param for user vector save
user_restore equ 01h ; param for user vector restore
em_seg equ 0 ; region in memory for 8087 emulator vectors
em_offs equ 0200h ; (these are saved in uda extension)
tot_emvecs equ 034h ; total = 14 vectors


View File

@@ -0,0 +1,121 @@
;************************************************
;*
;* Virtual Console Control Block Definition
;*
;* +---------+---------+---------+---------+
;* 00 | attach | queue |
;* +---------+---------+---------+---------+
;* 04 | flag | startcol| column | rsvrd |
;* +---------+---------+---------+---------+
;* 08 | mimic | msource | pc | vc |
;* +---------+---------+---------+---------+
;* 0C | btmp | rsvd | state |
;* +---------+---------+---------+---------+
;* 10 | maxbufsiz | vinq |
;* +---------+---------+---------+---------+
;* 14 | voutq | vcmxq |
;* +---------+---------+---------+---------+
;* 18 | qpbflags| qpbfill | qpbqaddr |
;* +---------+---------+---------+---------+
;* 1C | qpbnmsgs | qpbbuffptr |
;* +---------+---------+---------+---------+
;* 20 | qbuff | cosleep |
;* +---------+---------+---------+---------+
;* 24 | usleep | vsleep |
;* +---------+---------+---------+---------+
;* 28 | link + nchar |
;* +---------+---------+---------+---------+
;*
;*
;*
;* attach - current owner of device
;* if 0, no owner
;* if 0ffffh, a mimic device
;* queue - linked list of PDs waiting to attach
;* flag - run-time flags
;* startcol- used for line editing
;* column - used for line editing
;* rsvrd - reserved
;* mimic - cio dev that mimics us.
;* 0ffh means no mimic device
;* msource - if attach = 0ffffh, we are a
;* mimic device and msource is the
;* device we are mimicing.
;* pc - physical console number
;* vc - virtual console number
;* btmp - temporary line editing variable
;* rsvd - unused
;* state - current state of virtual console
;* maxbufsiz - maximum file size for buffered mode
;* vinq - address of QPB for this virtual console's
;* input. written by PIN, created by the VOUT
;* process associated with this virtual console
;* voutq - address of QPB for this virtual console's
;* output. written and created by the assoc. VOUT
;* vcmxq - MX queue for changing of virtual console state
;* qpbflags- the 1st 8 bytes of a Queue Parameter Block, for
;* queue reads and writes, used only by reentrant
;* intercept code
;* qbuff - buffer for queue writes
;* cosleep - temporary list for processes waiting for XIOS console output
;* usleep - user process sleeps here
;* vsleep - vout process sleeps here
;* link - links vc's with common physicals
;* nchar - 16 bit keyboard input lookahead for status
;*
c_attach equ word ptr 0
c_queue equ word ptr c_attach + word
c_flag equ byte ptr c_queue + word
c_strtcol equ byte ptr c_flag + byte
c_column equ byte ptr c_strtcol + byte
c_rsrvd equ byte ptr c_column + byte
c_mimic equ byte ptr c_rsrvd + byte
c_msource equ byte ptr c_mimic + byte
c_pc equ byte ptr c_msource + byte
c_vc equ byte ptr c_pc + byte
c_btmp equ byte ptr c_vc + byte
c_rsvd equ byte ptr c_btmp + byte
c_state equ word ptr c_rsvd + byte
c_maxbufsiz equ word ptr c_state + word
c_vinq equ word ptr c_maxbufsiz + word
c_voutq equ word ptr c_vinq + word
c_vcmxq equ word ptr c_voutq + word
c_qpbflags equ byte ptr c_vcmxq + word
c_qpbfill equ byte ptr c_qpbflags + byte
c_qpbqaddr equ word ptr c_qpbfill + byte
c_qpbnmsgs equ word ptr c_qpbqaddr + word
c_qpbbuffptr equ word ptr c_qpbnmsgs + word
c_qbuff equ word ptr c_qpbbuffptr + word
c_cosleep equ word ptr c_qbuff + word
c_usleep equ word ptr c_cosleep + word
c_vsleep equ word ptr c_usleep + word
c_link equ word ptr c_vsleep + word
c_nchar equ word ptr c_link + word
ccblen equ c_nchar + word
; Flags for c_flag
cf_listcp equ 001h ;control P toggle
cf_compc equ 002h ;suppress output
cf_switchs equ 004h ;XIOS supports switch screening
cf_conout equ 008h ;ownership flag of console output
cf_vout equ 010h ;process writing to VOUTQ
cf_bufp equ 020h ;just sent a char to a VOUTQ, don't
;echo to list if csm_ctrlP is set.
;CCB state flags
csm_buffered equ 00001h
csm_background equ 00002h
csm_purging equ 00004h
csm_noswitch equ 00008h
csm_suspend equ 00010h
csm_abort equ 00020h
csm_filefull equ 00040h
csm_ctrlS equ 00080h
csm_ctrlO equ 00100h
csm_ctrlP equ 00200h
;LCB - list control block is first ten bytes of VCCB
lcblen equ 10


View File

@@ -0,0 +1,40 @@
;*****************************************************
;*
;* XIOS function jump table offsets
;*
;*****************************************************
io_const equ 0
io_conin equ 1
io_conout equ 2
io_listst equ 3 ;not used
io_list equ 4
io_auxin equ 5 ;not used
io_auxout equ 6 ;not used
io_switch equ 7
io_statline equ 8
io_seldsk equ 9
io_read equ 10
io_write equ 11
io_flush equ 12
io_polldev equ 13
io_int13_read equ 35
io_int13_write equ 36
dio_13_read_op equ 0
dio_13_write_op equ 1
dio_25_read_op equ 2
dio_26_write_op equ 3
;*****************************************************
;*
;* XIOS Parameter Block for CALL XIOS functions
;*
;*****************************************************
xcb_func equ 0
xcb_cx equ word ptr xcb_func + byte
xcb_dx equ word ptr xcb_cx + word
xcblen equ xcb_dx + word