summaryrefslogtreecommitdiff
path: root/v2.0/source/MSDATA.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v2.0/source/MSDATA.ASM')
-rw-r--r--v2.0/source/MSDATA.ASM342
1 files changed, 342 insertions, 0 deletions
diff --git a/v2.0/source/MSDATA.ASM b/v2.0/source/MSDATA.ASM
new file mode 100644
index 0000000..ed524e8
--- /dev/null
+++ b/v2.0/source/MSDATA.ASM
@@ -0,0 +1,342 @@
1SUBTTL Initialized data and data used at DOS initialization
2PAGE
3; DATA AREA for MS-DOS
4
5IFNDEF KANJI
6KANJI EQU 0 ;FALSE
7ENDIF
8
9CONSTANTS SEGMENT BYTE PUBLIC 'CONST'
10 EXTRN international_table:BYTE
11 EXTRN Current_Country:WORD
12
13
14 ORG 0
15CONSTRT EQU $ ; Start of constants segment
16
17 PUBLIC DevStrLen
18DEVSTRLEN DB 3 ; Size of below
19 PUBLIC DevString
20DEVSTRING DB "DEV" ; Dummy device directory
21
22;
23; Table of routines for assignable devices
24;
25; MSDOS allows assignment if the following standard devices:
26; stdin (usually CON input)
27; stdout (usually CON output)
28; auxin (usually AUX input)
29; auxout (usually AUX output)
30; stdlpt (usually PRN output)
31;
32; SPECIAL NOTE:
33; Status of a file is a strange idea. We choose to handle it in this manner:
34; If we're not at end-of-file, then we always say that we have a character.
35; Otherwise, we return ^Z as the character and set the ZERO flag. In this
36; manner we can support program written under the old DOS (they use ^Z as EOF
37; on devices) and programs written under the new DOS (they use the ZERO flag
38; as EOF).
39
40; Default FCBs for boot up
41
42sftabl LABEL DWORD ; file table
43 DW -1
44 DW -1
45 DW sf_default_number ; Number of entries in table
46 DB sf_default_number DUP ( (SIZE sf_entry) DUP (0))
47
48 I_AM NoSetDir,BYTE ; true -> do not set directory
49 I_am DidCTRLC,BYTE ; true -> we did a ^C exit
50 I_am SpaceFlag,BYTE ; true -> embedded spaces are allowed
51 ; in FCB
52; the next two variables relate to the position of the logical stdout/stdin
53; cursor. They are only meaningful when stdin/stdout are assigned to the
54; console.
55
56 i_am CARPOS,BYTE ; cursor position in stdin
57 i_am STARTPOS,BYTE ; position of cursor at beginning
58 ; of buffered input call
59 I_AM PFLAG,BYTE
60 I_AM VERFLG,BYTE ; Initialize with verify off
61 I_AM CONTPOS,WORD
62 PUBLIC CHARCO
63CHARCO DB 00000011B ; Allows statchks every 4 chars...
64
65 I_AM DMAADD,DWORD ; User's disk transfer address
66 ; (disp/seg)
67 ORG $-CONSTRT-4
68 DW 80H
69 DW ?
70
71ENDMEM DW ?
72
73 PUBLIC switch_character
74switch_character DB '/'
75
76 PUBLIC device_availability
77device_availability DB 0FFH
78
79 I_AM FirstArena,WORD ; first free block found
80 I_AM BestArena,WORD ; best free block found
81 I_AM LastArena,WORD ; last free block found
82 I_AM AllocMethod,BYTE ; how to alloc first(best)last
83 I_AM arena_head,WORD
84
85; The following block of data is used by SYSINIT. Do not change the order or
86; size of this block
87
88 PUBLIC SYSINITVAR
89SYSINITVAR LABEL WORD
90 I_AM DPBHEAD,DWORD ; Pointer to head of DPB-FAT list
91 I_AM sft_addr,DWORD ; Pointer to first FCB table
92 ORG $-CONSTRT-4
93 short_addr sftabl
94 DW ? ; DOS segment set at INIT
95
96; The following address points to the CLOCK device
97 i_am BCLOCK,DWORD
98; The following address is used by DISKSTATCHK it is always points to the
99; console input device header
100 I_AM BCON,DWORD ; Console device entry points
101 i_am NUMIO,BYTE ; Number of disk tables
102MAXSEC DW 0 ; Maximum allowed sector size
103 I_AM BUFFHEAD,DWORD ; Pointer to head of buffer queue
104DEVHEAD LABEL DWORD
105 I_AM NULDEV,DWORD ; Set to list start passed by
106 ; BIOS at DOS Init
107
108 DW DEVTYP OR ISNULL
109 short_addr SNULDEV
110 short_addr INULDEV
111 DB "NUL "
112
113
114 i_am DAY,BYTE
115 i_am MONTH,BYTE
116 i_am YEAR,WORD
117 i_am DAYCNT,WORD
118 i_am WEEKDAY,BYTE
119 ORG $-CONSTRT-7
120 DB 0,0
121 DW 0,-1
122 DB 0
123
124 I_AM CURDRV,BYTE ; Default to drive A
125 I_AM LASTENT,WORD
126 i_am INDOS,BYTE ; DOS status for interrupt processing
127 ORG $-CONSTRT-1
128 DB 0
129 I_AM ErrorMode,BYTE ; Flag for INT 24 processing
130 PUBLIC WPErr
131WPERR DB -1 ; Write protect error flag
132 I_AM CONSWAP,BYTE
133 PUBLIC IDLEINT
134IDLEINT DB 1
135 PUBLIC CNTCFLAG
136CNTCFLAG DB 0 ; ^C check in dispatch disabled
137
138 PUBLIC LastBuffer
139LASTBUFFER LABEL DWORD ; Buffer queue recency pointer
140 DW -1
141 DW -1
142
143; Combination of all device call parameters
144
145 PUBLIC DEVCALL
146DEVCALL SRHEAD <>
147CALLUNIT LABEL BYTE
148CALLFLSH LABEL WORD
149 I_AM CALLMED,BYTE
150CALLBR LABEL DWORD
151 PUBLIC CALLXAD
152CALLXAD LABEL DWORD
153 I_AM CALLRBYT,BYTE
154 DB 3 DUP(?)
155 PUBLIC CallBPB
156CALLBPB LABEL DWORD
157 I_AM CALLSCNT,WORD
158CALLSSEC DW ?
159
160 I_AM CALLDEVAD,DWORD ; stash for device entry point
161
162; Same as above for I/O calls
163
164 PUBLIC IOCall
165IOCALL SRHEAD <>
166IOFLSH LABEL WORD
167 PUBLIC IORCHR
168IORCHR LABEL BYTE
169 I_AM IOMED,BYTE
170 I_AM IOXAD,DWORD
171 I_AM IOSCNT,WORD
172 I_AM IOSSEC,WORD
173
174; Call struct for DSKSTATCHK
175 PUBLIC DSKSTCALL
176DSKSTCALL DB DRDNDHL
177 DB 0
178 PUBLIC DSKSTCOM
179DSKSTCOM DB DEVRDND
180 I_AM DSKSTST,WORD
181 DB 8 DUP (0)
182 I_AM DSKCHRET,BYTE
183 short_addr DEVIOBUF
184 DW ? ; DOS segment set at Init
185 PUBLIC DSKSTCNT
186DSKSTCNT DW 1
187 DW 0
188
189; Days in year
190 i_am YRTAB,8
191 ORG $-CONSTRT-8
192 DB 200,166 ; Leap year
193 DB 200,165
194 DB 200,165
195 DB 200,165
196
197; Days of each month
198 i_am MONTAB,12
199 ORG $-CONSTRT-12
200 DB 31 ; January
201 DB 28 ; February--reset each
202 ; time year changes
203 DB 31 ; March
204 DB 30 ; April
205 DB 31 ; May
206 DB 30 ; June
207 DB 31 ; July
208 DB 31 ; August
209 DB 30 ; September
210 DB 31 ; October
211 DB 30 ; November
212 DB 31 ; December
213
214 IF NOT IBM
215 PUBLIC OEM_HANDLER
216OEM_HANDLER DD -1
217 ENDIF
218
219;WARNING For HIGHMEM version, these two vars must be at the end of the
220; Constants segment to prevent them getting overwritten.
221 I_AM CurrentPDB,WORD
222 i_am CreatePDB,BYTE ; flag for creating a process
223
224 PUBLIC LEAVEADDR
225LEAVEADDR LABEL WORD
226 short_addr LEAVE
227
228CONSTANTS ENDS
229
230SUBTTL Uninitialized data overlayed by initialization code
231PAGE
232DATA SEGMENT WORD PUBLIC 'DATA'
233; Init code overlaps with data area below
234
235 ORG 0
236 i_am INBUF,128
237 I_AM CONBUF,131 ; The rest of INBUF and console buffer
238 i_am TIMEBUF,6
239 I_AM DEVIOBUF,2 ; Buffer for I/O under file assignment
240 I_AM EXITHOLD,DWORD
241
242 PUBLIC DevFCB
243DEVFCB LABEL BYTE ; Uses NAME1, NAME2, NAME3 combined
244; WARNING.. do not alter size or relative location of the following 4 items
245; without first examining FCB_RENAME
246 I_AM NAME1,12 ; File name buffer
247 I_AM ATTRIB,BYTE
248 I_AM NAME2,13
249 I_AM NAME3,14
250
251 I_AM EXTFCB,BYTE
252
253; WARNING - the following two items are accessed as a word
254 I_AM CREATING,BYTE
255 I_AM DELALL,BYTE
256
257 I_AM FoundDel,BYTE
258
259 I_AM user_SP,WORD
260 I_AM user_SS,WORD
261 I_AM CONTSTK,WORD
262 I_AM SECCLUSPOS,BYTE ; Position of first sector
263 ; within cluster
264 I_AM DSKERR,BYTE
265 I_AM TRANS,BYTE
266 I_AM READOP,BYTE
267 I_AM THISDRV,BYTE
268 I_AM THISDPB,DWORD
269 I_AM CLUSFAC,BYTE
270
271; WARNING - the following two items are accessed as a word
272 I_AM DRIVESPEC,BYTE
273 I_AM ROOTSTART,BYTE
274
275 I_AM CLUSSPLIT,BYTE
276 i_am INSMODE,BYTE
277 I_AM CLUSSAVE,WORD
278 I_AM CLUSSEC,WORD
279 I_AM PREREAD,WORD ; 0 means preread; 1 means optional
280 I_AM FATBYT,WORD
281 I_AM DEVPT,DWORD
282 I_AM THISFCB,DWORD ; Address of user FCB
283
284 I_AM NEXTADD,WORD
285 I_AM RECPOS,4
286 I_AM RECCNT,WORD
287 I_AM LASTPOS,WORD
288 I_AM CLUSNUM,WORD
289 I_AM DIRSEC,WORD
290 I_AM DIRSTART,WORD
291 I_AM SECPOS,WORD ; Position of first sector accessed
292 I_AM VALSEC,WORD ; Number of valid (previously written)
293 ; sectors
294 I_AM BYTSECPOS,WORD ; Position of first byte within sector
295 I_AM BYTPOS,4 ; Byte position in file of access
296 I_AM BYTCNT1,WORD ; No. of bytes in first sector
297 I_AM BYTCNT2,WORD ; No. of bytes in last sector
298 I_AM SECCNT,WORD ; No. of whole sectors
299 I_AM ENTFREE,WORD
300 I_AM ENTLAST,WORD
301 I_AM NXTCLUSNUM,WORD
302 I_AM GROWCNT,DWORD
303 I_AM CURBUF,DWORD
304 I_AM VOLID,BYTE
305 I_AM NULLDEVPT,DWORD
306 I_AM CINSAV,DWORD
307 I_AM CINDSAV,BYTE
308 I_AM COUTDSAV,BYTE
309 I_AM COUTSAV,DWORD
310 PUBLIC SaveBX
311SaveBX DW ?
312 PUBLIC SaveDS
313SaveDS DW ?
314 I_AM ConC_spsave,WORD
315
316 I_AM exit_code,WORD ; exit code of last proc.
317 I_am exit_type,BYTE ; type of exit...
318
319 IF IBM
320;For 2.00 this pads the DOS so that on a 2 disk IBM PC with no
321;CONFIG.SYS file the space taken up by BIOS, DOS, res COMMAND is
322;about 24K
323IBMPAD DB 540h DUP(?)
324 ENDIF
325
326; make those pushes fast!!!
327EVEN
328 DB 0A0H DUP (?)
329 I_am AuxStack,0A0h
330 I_AM DSKSTACK,0A0h ; Stack space
331 PUBLIC IOSTACK
332IOSTACK LABEL BYTE
333
334 PUBLIC NSS
335NSS DW ?
336 PUBLIC NSP
337NSP DW ?
338
339PAGE
340 INCLUDE MSINIT.ASM
341
342 \ No newline at end of file