;******************* BDOS data area ********************
;
;
;       8086 variables that must recide in code segment
;
cseg    $
;
axsave                  dw      0       ; register saves
SS_save                 dw      0
SP_save                 dw      0
;
;       Variables in data segment:
;
dseg    cpmsegment
        org     bdosoffset+bdoscodesize
;
;       byte I/O variables:
;
compcol db      0               ;true if computing column position
strtcol db      0               ;starting column position after read
column  db      0               ;column position
listcp  db      0               ;listing toggle
kbchar  db      0               ;initial key char = 00
;
;       common values shared between bdosi and bdos
;
usrcode db      0                       ;current user number
curdsk  db      0                       ;current disk number
info    dw      0                       ;information address
aret    dw      0                       ;address value to return
lret    EQU     byte ptr aret           ;low(aret)
;
;       data areas for file system:
;
;       initialized data
;
efcb    db      empty           ;0e5=available dir entry
rodsk   dw      0               ;read only disk vector
dlog    dw      0               ;logged-in disks
dmaad   dw      0               ;dma address
;
;       curtrka - alloca are set upon disk select
;       (data must be adjacent, do not insert variables)
;       (address of translate vector, not used)
;
cdrmaxa dw      0               ;pointer to cur dir max value
curtrka dw      0               ;current track address
curreca dw      0               ;current record address
buffa   dw      0               ;pointer to directory dma address
dpbaddr dw      0               ;current disk parameter block address
checka  dw      0               ;current checksum vector address
alloca  dw      0               ;current allocation vector address
addlist EQU     8               ;"$-buffa" = address list size
;
;       sectpt - offset obtained from disk parm block at dpbaddr
;       (data must be adjacent, do not insert variables)
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               ;maximum allocation number
dirmax  dw      0               ;largest directory number
dirblk  dw      0               ;reserved allocation bits for direct.
chksiz  dw      0               ;size of checksum vector
offsetv dw      0               ;offset tracks at beginning
endlist rs      0               ;end of list
dpblist equ     (offset endlist)-(offset sectpt)        ;size
;
;       local variables
tranv   dw      0               ;address of translate vector
fcbcopied  db   0               ;set true if copy$fcb called
rmf     db      0               ;read mode flag for open$reel
dirloc  db      0               ;directory flag in rename, etc.
seqio   db      0               ;1 if sequential i/o
linfo   db      0               ;low(info)
dminx   db      0               ;local for diskwrite
srchl   db      0               ;search length
srcha   dw      0               ;search address
tinfo   dw      0               ;temp for info in "make"
single  db      0               ;set true if single byte 
                                ;allocation map
resel   db      0               ;reselection flag
olddsk  db      0               ;disk on entry to bdos
fcbdsk  db      0               ;disk named in fcb
rcount  db      0               ;record count in current fcb
extval  db      0               ;extent number and extmsk
vrecord dw      0               ;current virtual record
lvrecord equ    byte ptr vrecord ;low (vrecord)
arecord dw      0               ;current actual record
ablock  dw      0               ;current actual block# * blkmsk
;
;       local variables for directory access
dptr    db      0               ;directory pointer 0,1,2,3
dcnt    dw      0               ;directory counter 0,1,...,dirmax
ldcnt   equ     byte ptr dcnt   ;low(dcnt)
drec    dw      0               ;directory record 0,1,...,dirmax/4
;
;       Special 8086 variables:
;
ioloc           db      0       ;iobyte
dmabase         dw      0       ;segment base for disk I/O
infosave        dw      0       ;save for FCB address
parametersegment dw     0       ;user parameter segment
parcopfl        db      0       ;true if parameter block copied
parlg           db      0       ;length of parameter block
nallocmem       db      0       ;no. of allocated memory segments
ncrmem          db      0       ;no. of available memory segments
crmem           dw      0,0     ;memory table (16 elements)
                dw      0,0,0,0,0,0
                dw      0,0,0,0,0,0,0,0
                dw      0,0,0,0,0,0,0,0
                dw      0,0,0,0,0,0,0,0
;
;
;       error messages
;
dskmsg  db      'Bdos Err On '
dskerr  db      ' : $'                  ;filled in by errflg
permsg  db      'Bad Sector$'
selmsg  db      'Select$'
rofmsg  db      'File '
rodmsg  db      'R/O$'
;
;       Local buffer area:
;
loc_par_area    rb      258     ;local user parameter (FCB,...)
stackarea       rw      ssize   ;stack size
endstack        rb      0       ;top of stack
;
;******************** end BDOS data area *******************
end
