summaryrefslogtreecommitdiff
path: root/v2.0/source/DOSSYM_v211.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v2.0/source/DOSSYM_v211.ASM')
-rw-r--r--v2.0/source/DOSSYM_v211.ASM963
1 files changed, 963 insertions, 0 deletions
diff --git a/v2.0/source/DOSSYM_v211.ASM b/v2.0/source/DOSSYM_v211.ASM
new file mode 100644
index 0000000..106e115
--- /dev/null
+++ b/v2.0/source/DOSSYM_v211.ASM
@@ -0,0 +1,963 @@
1include DOSMAC.ASM
2IF2
3 %OUT DOSSYM in Pass 2
4ENDIF
5
6IFNDEF ALTVECT
7ALTVECT EQU 0 ;FALSE
8ENDIF
9
10DOS_MAJOR_VERSION EQU 2
11DOS_MINOR_VERSION EQU 11
12
13BREAK <Control character definitions>
14
15c_DEL EQU 7Fh ; ASCII rubout or delete previous char
16c_BS EQU 08h ; ^H ASCII backspace
17c_CR EQU 0Dh ; ^M ASCII carriage return
18c_LF EQU 0Ah ; ^J ASCII linefeed
19c_ETB EQU 17h ; ^W ASCII end of transmission
20c_NAK EQU 15h ; ^U ASCII negative acknowledge
21c_ETX EQU 03h ; ^C ASCII end of text
22c_HT EQU 09h ; ^I ASCII tab
23
24BREAK <BPB Definition>
25
26
27;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
28; ;
29; C A V E A T P R O G R A M M E R ;
30; ;
31; Certain structures, constants and system calls below are private to ;
32; the DOS and are extremely version-dependent. They may change at any ;
33; time at the implementors' whim. As a result, they must not be ;
34; documented to the general public. If an extreme case arises, they ;
35; must be documented with this warning. ;
36; ;
37; Those structures and constants that are subject to the above will be ;
38; marked and bracketed with the flag: ;
39; ;
40; C A V E A T P R O G R A M M E R ;
41; ;
42;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
43
44BREAK <Bios Parameter Block>
45;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
46; C A V E A T P R O G R A M M E R ;
47; ;
48
49; Bios Parameter Block definition
50; This structure is used to build a full DPB
51
52BPBLOCK STRUC
53BPSECSZ DW ? ; Size in bytes of physical sector
54BPCLUS DB ? ; Sectors/Alloc unit
55BPRES DW ? ; Number of reserved sectors
56BPFTCNT DB ? ; Number of FATs
57BPDRCNT DW ? ; Number of directory entries
58BPSCCNT DW ? ; Total number of sectors
59BPMEDIA DB ? ; Media descriptor byte
60BPFTSEC DW ? ; Number of sectors taken up by one FAT
61BPBLOCK ENDS
62; ;
63; C A V E A T P R O G R A M M E R ;
64;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
65
66BREAK <Disk I/O Buffer Header>
67;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
68; C A V E A T P R O G R A M M E R ;
69; ;
70
71; Field definition for I/O buffer information
72
73BUFFINFO STRUC
74NEXTBUF DD ? ; Pointer to next buffer in list
75; The next two items are often refed as a word
76BUFDRV DB ? ; Logical drive # assoc with buffer FF = free
77BUFDIRTY DB ? ; Dirty flag
78BUFPRI DB ? ; Buffer selection priority (see EQUs below)
79VISIT DB ? ; Visit flag for buffer pool scans
80BUFSECNO DW ? ; Sector number of buffer
81; The next two items are often refed as a word
82BUFWRTCNT DB ? ; For FAT sectors, # times sector written out
83BUFWRTINC DB ? ; " " " , # sectors between each write
84BUFDRVDP DD ? ; Pointer to drive parameters
85BUFFINFO ENDS
86
87BUFINSIZ EQU SIZE BUFFINFO
88 ; Size of structure in bytes
89
90FREEPRI EQU 0
91LBRPRI EQU 2 ; Last byte of buffer read
92LBWPRI EQU 4 ; Last byte written
93RPRI EQU 6 ; Read but not last byte
94WPRI EQU 8 ; Written but not last byte
95DIRPRI EQU 15 ; Directory Sector
96FATPRI EQU 30 ; FAT sector
97; ;
98; C A V E A T P R O G R A M M E R ;
99;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
100
101BREAK <User stack inside of system call>
102; Location of user registers relative user stack pointer
103
104user_environ STRUC
105user_AX DW ?
106user_BX DW ?
107user_CX DW ?
108user_DX DW ?
109user_SI DW ?
110user_DI DW ?
111user_BP DW ?
112user_DS DW ?
113user_ES DW ?
114user_IP DW ?
115user_CS DW ?
116user_F DW ?
117user_environ ENDS
118
119BREAK <interrupt definitions>
120
121INTTAB EQU 20H
122INTBASE EQU 4 * inttab
123ENTRYPOINT EQU INTBASE+40H
124
125 IF ALTVECT
126ALTTAB EQU 0F0H
127ALTBASE EQU 4 * ALTTAB
128 ENDIF
129
130;
131; interrupt assignments
132;
133 IF NOT ALTVECT
134int_abort EQU INTTAB ; abort process
135int_command EQU int_abort+1 ; call MSDOS
136int_terminate EQU int_abort+2 ; int to terminate address
137int_ctrl_c EQU int_abort+3 ; ^c trapper
138int_fatal_abort EQU int_abort+4 ; hard disk error
139int_disk_read EQU int_abort+5 ; logical sector disk read
140int_disk_write EQU int_abort+6 ; logical sector disk write
141int_keep_process EQU int_abort+7 ; terminate program and stay
142 ; resident
143;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
144; C A V E A T P R O G R A M M E R ;
145; ;
146int_spooler EQU int_abort+8 ; spooler call
147int_fastcon EQU int_abort+9 ; fast CON interrupt
148; ;
149; C A V E A T P R O G R A M M E R ;
150;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
151 ELSE
152int_abort EQU INTTAB ; abort process
153int_command EQU int_abort+1 ; call MSDOS
154int_terminate EQU ALTTAB ; int to terminate address
155int_ctrl_c EQU int_terminate+1 ; ^c trapper
156int_fatal_abort EQU int_terminate+2 ; hard disk error
157int_disk_read EQU int_abort+5 ; logical sector disk read
158int_disk_write EQU int_abort+6 ; logical sector disk write
159int_keep_process EQU int_abort+7 ; terminate program and stay
160 ; resident
161;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
162; C A V E A T P R O G R A M M E R ;
163; ;
164int_spooler EQU int_terminate+3 ; spooler call
165int_fastcon EQU int_abort+9 ; fast CON interrupt
166; ;
167; C A V E A T P R O G R A M M E R ;
168;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
169 ENDIF
170
171addr_int_abort EQU 4 * int_abort
172addr_int_command EQU 4 * int_command
173addr_int_terminate EQU 4 * int_terminate
174addr_int_ctrl_c EQU 4 * int_ctrl_c
175addr_int_fatal_abort EQU 4 * int_fatal_abort
176addr_int_disk_read EQU 4 * int_disk_read
177addr_int_disk_write EQU 4 * int_disk_write
178addr_int_keep_process EQU 4 * int_keep_process
179;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
180; C A V E A T P R O G R A M M E R ;
181; ;
182addr_int_spooler EQU 4 * int_spooler
183addr_int_fastcon EQU 4 * int_fastcon
184; ;
185; C A V E A T P R O G R A M M E R ;
186;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
187
188BREAK <Disk map>
189; MSDOS partitions the disk into 4 sections:
190;
191; phys sector 0: +-------------------+
192; | | boot/reserved |
193; | +-------------------+
194; | | File allocation |
195; v | table(s) |
196; | (multiple copies |
197; | are kept) |
198; +-------------------+
199; | Directory |
200; +-------------------+
201; | File space |
202; +-------------------+
203; | Unaddressable |
204; | (to end of disk) |
205; +-------------------+
206;
207; All partition boundaries are sector boundaries. The size of the FAT is
208; adjusted to maximize the file space addressable.
209
210BREAK <Directory entry>
211
212;
213; +---------------------------+
214; | (12 BYTE) filename/ext | 0 0
215; +---------------------------+
216; | (BYTE) attributes | 11 B
217; +---------------------------+
218; | (10 BYTE) reserved | 12 C
219; +---------------------------+
220; | (WORD) time of last write | 22 16
221; +---------------------------+
222; | (WORD) date of last write | 24 18
223; +---------------------------+
224; | (WORD) First cluster | 26 1A
225; +---------------------------+
226; | (DWORD) file size | 28 1C
227; +---------------------------+
228;
229; First byte of filename = E5 -> free directory entry
230; = 00 -> end of allocated directory
231; Time: Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour
232; Date: Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980
233;
234dir_entry STRUC
235dir_name DB 11 DUP (?) ; file name
236dir_attr DB ? ; attribute bits
237dir_pad DB 10 DUP (?) ; reserved for expansion
238dir_time DW ? ; time of last write
239dir_date DW ? ; date of last write
240dir_first DW ? ; first allocation unit of file
241dir_size_l DW ? ; low 16 bits of file size
242dir_size_h DW ? ; high 16 bits of file size
243dir_entry ENDS
244
245attr_read_only EQU 1h
246attr_hidden EQU 2h
247attr_system EQU 4h
248attr_volume_id EQU 8h
249attr_directory EQU 10h
250attr_archive EQU 20h
251
252attr_all EQU attr_hidden+attr_system+attr_directory
253 ; OR of hard attributes for FINDENTRY
254
255attr_ignore EQU attr_read_only+attr_archive
256 ; ignore this(ese) attribute(s) during
257 ; search first/next
258
259attr_changeable EQU attr_read_only+attr_hidden+attr_system+attr_archive
260 ; changeable via CHMOD
261
262BREAK <File allocation Table information>
263;
264; The File Allocation Table uses a 12-bit entry for each allocation unit on
265; the disk. These entries are packed, two for every three bytes. The contents
266; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
267; to the base address of the Allocation Table; 3) fetching the 16-bit word
268; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
269; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
270; number zero is used as an end-of-file trap in the OS and is passed to the
271; BIOS to help determine disk format. Entry 1 is reserved for future use.
272; The first available allocation unit is assigned entry number two, and even
273; though it is the first, is called cluster 2. Entries greater than 0FF8H
274; are end of file marks; entries of zero are unallocated. Otherwise, the
275; contents of a FAT entry is the number of the next cluster in the file.
276;
277; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
278; do because these clusters show as allocated, but are not part of any
279; allocation chain and thus will never be allocated to a file. A particular
280; number is selected so that disk checking programs know what to do (ie. a
281; cluster with entry FF7H which is not in a chain is not an error).
282
283BREAK <DPB structure>
284;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
285; C A V E A T P R O G R A M M E R ;
286; ;
287
288DIRSTRLEN EQU 64 ; Max length in bytes of directory strings
289
290dpb STRUC
291dpb_drive DB ? ; Logical drive # assoc with DPB (A=0,B=1,...)
292dpb_UNIT DB ? ; Driver unit number of DPB
293dpb_sector_size DW ? ; Size of physical sector in bytes
294dpb_cluster_mask DB ? ; Sectors/cluster - 1
295dpb_cluster_shift DB ? ; Log2 of sectors/cluster
296dpb_first_FAT DW ? ; Starting record of FATs
297dpb_FAT_count DB ? ; Number of FATs for this drive
298dpb_root_entries DW ? ; Number of directory entries
299dpb_first_sector DW ? ; First sector of first cluster
300dpb_max_cluster DW ? ; Number of clusters on drive + 1
301dpb_FAT_size DB ? ; Number of records occupied by FAT
302dpb_dir_sector DW ? ; Starting record of directory
303dpb_driver_addr DD ? ; Pointer to driver
304dpb_media DB ? ; Media byte
305dpb_first_access DB ? ; This is initialized to -1 to force a media
306 ; check the first time this DPB is used
307dpb_next_dpb DD ? ; Pointer to next Drive parameter block
308dpb_current_dir DW ? ; Cluster number of start of current directory
309 ; 0 indicates root, -1 indicates invalid (disk
310 ; ? changed)
311dpb_dir_text DB DIRSTRLEN DUP(?)
312 ; ASCIZ string of current directory
313dpb ENDS
314
315DPBSIZ EQU SIZE dpb ; Size of the structure in bytes
316
317DSKSIZ = dpb_max_cluster ; Size of disk (temp used during init only)
318; ;
319; C A V E A T P R O G R A M M E R ;
320;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
321
322BREAK <File Control Block definition>
323;
324; Field definition for FCBs
325; The FCB has the following structure:
326;
327; +---------------------------+
328; | Drive indicator(byte) |
329; +---------------------------+
330; | Filename (8 chars) |
331; +---------------------------+
332; | Extension (3 chars) |
333; +---------------------------+
334; | Current Extent(word) |
335; +---------------------------+
336; | Record size (word) |
337; +---------------------------+
338; | File Size (2 words) |
339; +---------------------------+
340; | Date of write |
341; +---------------------------+
342; | Time of write |
343; +---------------------------+
344;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
345; C A V E A T P R O G R A M M E R ;
346; ;
347; | Flags: |
348; | bit 7=0 file/1 device |
349; | bit 6=0 if dirty |
350; | bits 0-5 deviceid |
351; +---------------------------+
352; | first cluster in file |
353; +---------------------------+
354; | position of last cluster |
355; +---------------------------+
356; | last cluster accessed | 12 bit-+--- packed in 3 bytes
357; +---------------------------+ |
358; | parent directory | <------+
359; +---------------------------+
360; ;
361; C A V E A T P R O G R A M M E R ;
362;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
363; | next record number |
364; +---------------------------+
365; | random record number |
366; +---------------------------+
367;
368
369sys_fcb STRUC
370fcb_drive DB ?
371fcb_name DB 8 DUP (?)
372fcb_ext DB 3 DUP (?)
373fcb_EXTENT DW ?
374fcb_RECSIZ DW ? ; Size of record (user settable)
375fcb_FILSIZ DW ? ; Size of file in bytes; used with the following
376 ; word
377fcb_DRVBP DW ? ; BP for SEARCH FIRST and SEARCH NEXT
378fcb_FDATE DW ? ; Date of last writing
379fcb_FTIME DW ? ; Time of last writing
380;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
381; C A V E A T P R O G R A M M E R ;
382; ;
383fcb_DEVID DB ? ; Device ID number, bits 0-5 if file.
384 ; bit 7=0 for file, bit 7=1 for I/O device
385 ; If file, bit 6=0 if dirty
386 ; If I/O device, bit 6=0 if EOF (input)
387 ; Bit 5=1 if Raw mode
388 ; Bit 0=1 if console input device
389 ; Bit 1=1 if console output device
390 ; Bit 2=1 if null device
391 ; Bit 3=1 if clock device
392fcb_FIRCLUS DW ? ; First cluster of file
393fcb_CLUSPOS DW ? ; Position of last cluster accessed
394fcb_LSTCLUS DW ? ; Last cluster accessed and directory pack 2 12
395 DB ? ; bit numbers into 24 bits...
396; ;
397; C A V E A T P R O G R A M M E R ;
398;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
399fcb_NR DB ? ; Next record
400fcb_RR DB 4 DUP (?) ; Random record
401sys_fcb ENDS
402
403FILDIRENT = fcb_FILSIZ ; Used only by SEARCH FIRST and SEARCH
404 ; NEXT
405
406;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
407; C A V E A T P R O G R A M M E R ;
408; ;
409devid_file_clean EQU 40h ; true if file and not written
410devid_file_mask_drive EQU 3Fh ; mask for drive number
411
412devid_device EQU 80h ; true if a device
413devid_device_EOF EQU 40h ; true if end of file reached
414devid_device_raw EQU 20h ; true if in raw mode
415devid_device_special EQU 10h ; true if special device
416devid_device_clock EQU 08h ; true if clock device
417devid_device_null EQU 04h ; true if null device
418devid_device_con_out EQU 02h ; true if console output
419devid_device_con_in EQU 01h ; true if consle input
420
421;
422; structure of devid field as returned by IOCTL is:
423;
424; BIT 7 6 5 4 3 2 1 0
425; |---|---|---|---|---|---|---|---|
426; | I | E | R | S | I | I | I | I |
427; | S | O | A | P | S | S | S | S |
428; | D | F | W | E | C | N | C | C |
429; | E | | | C | L | U | O | I |
430; | V | | | L | K | L | T | N |
431; |---|---|---|---|---|---|---|---|
432; ISDEV = 1 if this channel is a device
433; = 0 if this channel is a disk file
434;
435; If ISDEV = 1
436;
437; EOF = 0 if End Of File on input
438; RAW = 1 if this device is in Raw mode
439; = 0 if this device is cooked
440; ISCLK = 1 if this device is the clock device
441; ISNUL = 1 if this device is the null device
442; ISCOT = 1 if this device is the console output
443; ISCIN = 1 if this device is the console input
444;
445; If ISDEV = 0
446; EOF = 0 if channel has been written
447; Bits 0-5 are the block device number for
448; the channel (0 = A, 1 = B, ...)
449;
450devid_ISDEV EQU 80h
451devid_EOF EQU 40h
452devid_RAW EQU 20h
453devid_SPECIAL EQU 10H
454devid_ISCLK EQU 08h
455devid_ISNUL EQU 04h
456devid_ISCOT EQU 02h
457devid_ISCIN EQU 01h
458
459devid_block_dev EQU 1Fh ; mask for block device number
460
461;
462; find first/next buffer
463;
464find_buf STRUC
465find_buf_sattr DB ? ; attribute of search
466find_buf_drive DB ? ; drive of search
467find_buf_name DB 11 DUP (?) ; formatted name
468find_buf_LastEnt DW ? ; LastEnt
469find_buf_ThisDPB DD ? ; This DPB
470find_buf_DirStart DW ? ; DirStart
471; ;
472; C A V E A T P R O G R A M M E R ;
473;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
474
475find_buf_attr DB ? ; attribute found
476find_buf_time DW ? ; time
477find_buf_date DW ? ; date
478find_buf_size_l DW ? ; low(size)
479find_buf_size_h DW ? ; high(size)
480find_buf_pname DB 13 DUP (?) ; packed name
481find_buf ENDS
482
483BREAK <Process data block>
484;
485; Process data block (otherwise known as program header)
486;
487
488FilPerProc EQU 20
489
490Process_data_block STRUC
491PDB_Exit_Call DW ? ; INT int_abort system terminate
492PDB_block_len DW ? ; size of execution block
493 DB ?
494PDB_CPM_Call DB 5 DUP (?) ; ancient call to system
495PDB_Exit DD ? ; pointer to exit routine
496PDB_Ctrl_C DD ? ; pointer to ^C routine
497PDB_Fatal_abort DD ? ; pointer to fatal error
498;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
499; C A V E A T P R O G R A M M E R ;
500; ;
501PDB_Parent_PID DW ? ; PID of parent (terminate PID)
502PDB_JFN_Table DB FilPerProc DUP (?)
503 ; indices into system table
504; ;
505; C A V E A T P R O G R A M M E R ;
506;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
507PDB_environ DW ? ; seg addr of environment
508;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
509; C A V E A T P R O G R A M M E R ;
510; ;
511PDB_User_stack DD ? ; stack of self during system calls
512PDB_PAD1 DB 1Eh DUP (?)
513; ;
514; C A V E A T P R O G R A M M E R ;
515;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
516PDB_Call_system DB 5 DUP (?) ; portable method of system call
517;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
518; C A V E A T P R O G R A M M E R ;
519; ;
520PDB_PAD2 DB 6h DUP (?) ;
521; ;
522; C A V E A T P R O G R A M M E R ;
523;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
524Process_data_block ENDS
525
526BREAK <EXEC and EXE file structures>
527;
528; EXEC arg block - load/go program
529;
530
531;
532; The following get used as arguments to the EXEC system call. They indicate
533; whether or not the program is executed or whether or not a program header
534; gets created.
535;
536exec_func_no_execute EQU 1 ; no execute bit
537exec_func_overlay EQU 2 ; overlay bit
538
539Exec0 STRUC
540Exec0_environ DW ? ; seg addr of environment
541Exec0_com_line DD ? ; pointer to asciz command line
542Exec0_5C_FCB DD ? ; default fcb at 5C
543Exec0_6C_FCB DD ? ; default fcb at 6C
544Exec0 ENDS
545
546Exec1 STRUC
547Exec1_environ DW ? ; seg addr of environment
548Exec1_com_line DD ? ; pointer to asciz command line
549Exec1_5C_FCB DD ? ; default fcb at 5C
550Exec1_6C_FCB DD ? ; default fcb at 6C
551Exec1_SP DW ? ; stack pointer of program
552Exec1_SS DW ? ; stack seg register of program
553Exec1_IP DW ? ; entry point IP
554Exec1_CS DW ? ; entry point CS
555Exec1 ENDS
556
557Exec3 STRUC
558Exec3_load_addr DW ? ; seg address of load point
559Exec3_reloc_fac DW ? ; relocation factor
560Exec3 ENDS
561
562;
563; Exit codes in upper byte
564;
565Exit_terminate EQU 0
566Exit_abort EQU 0
567Exit_Ctrl_C EQU 1
568Exit_Hard_Error EQU 2
569Exit_Keep_process EQU 3
570
571;
572; EXE file header
573;
574
575EXE_file STRUC
576exe_signature DW ? ; must contain 4D5A (yay zibo!)
577exe_len_mod_512 DW ? ; low 9 bits of length
578exe_pages DW ? ; number of 512b pages in file
579exe_rle_count DW ? ; count of reloc entries
580exe_par_dir DW ? ; number of paragraphs before image
581exe_min_BSS DW ? ; minimum number of para of BSS
582exe_max_BSS DW ? ; max number of para of BSS
583exe_SS DW ? ; stack of image
584exe_SP DW ? ; SP of image
585exe_chksum DW ? ; checksum of file (ignored)
586exe_IP DW ? ; IP of entry
587exe_CS DW ? ; CS of entry
588exe_rle_table DW ? ; byte offset of reloc table
589exe_iov DW ? ; overlay number (0 for root)
590exe_sym_tab DD ? ; offset of symbol table in file
591EXE_file ENDS
592
593exe_valid_signature EQU 5A4Dh
594exe_valid_old_signature EQU 4D5Ah
595
596symbol_entry STRUC
597sym_value DD ?
598sym_type DW ?
599sym_len DB ?
600sym_name DB 255 dup (?)
601symbol_entry ENDS
602
603BREAK <Internal system file table format>
604;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
605; C A V E A T P R O G R A M M E R ;
606; ;
607;
608; system file table
609;
610
611sft STRUC
612sft_link DD ?
613sft_count DW ? ; number of entries
614sft_table DW ? ; beginning of array of the following
615sft ENDS
616
617;
618; system file table entry
619;
620
621sf_entry STRUC
622sf_ref_count DB ? ; number of processes sharing fcb
623sf_mode DB ? ; mode of access
624sf_attr DB ? ; attribute of file
625sf_fcb DB (SIZE sys_fcb) DUP (?)
626 ; actual FCB
627sf_entry ENDS
628
629sf_default_number EQU 5h
630; ;
631; C A V E A T P R O G R A M M E R ;
632;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
633
634BREAK <Memory arena structure>
635;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
636; C A V E A T P R O G R A M M E R ;
637; ;
638;
639; arena item
640;
641arena STRUC
642arena_signature DB ? ; 4D for valid item, 5A for last item
643arena_owner DW ? ; owner of arena item
644arena_size DW ? ; size in paragraphs of item
645arena ENDS
646
647;
648; Current structure of the data returned by the international call
649;
650
651internat_block STRUC
652Date_tim_format DW ? ; 0-USA, 1-EUR, 2-JAP
653Currency_sym DB ? ; Currency Symbol 5 bytes
654 DB ?
655 DB ?
656 DB ?
657 DB ?
658Thous_sep DB ? ; Thousands separator 2 bytes
659 DB ?
660Decimal_sep DB ? ; Decimal separator 2 bytes
661 DB ?
662Date_sep DB ? ; Date separator 2 bytes
663 DB ?
664Time_sep DB ? ; Decimal separator 2 bytes
665 DB ?
666Bit_feild DB ? ; Bit values
667 ; Bit 0 = 0 if currency symbol first
668 ; = 1 if currency symbol last
669 ; Bit 1 = 0 if No space after currency symbol
670 ; = 1 if space after currency symbol
671Currency_cents DB ? ; Number of places after currency dec point
672Time_24 DB ? ; 1 if 24 hour time, 0 if 12 hour time
673Map_call DW ? ; Address of case mapping call (DWORD)
674 DW ? ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED
675 ; in pieces.
676Data_sep DB ? ; Data list separator character
677 DB ?
678internat_block ENDS
679
680;
681; Max size of the block returned by the INTERNATIONAL call
682;
683internat_block_max EQU 32
684
685;
686; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature
687; and arena_owner_system are all equal to zero and are contained in DI. Change
688; them and change ALLOC.ASM.
689
690arena_owner_system EQU 0 ; free block indication
691
692arena_signature_normal EQU 4Dh ; valid signature, not end of arena
693arena_signature_end EQU 5Ah ; valid signature, last block in arena
694; ;
695; C A V E A T P R O G R A M M E R ;
696;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
697
698BREAK <Machine instruction definitions>
699
700mi_INT EQU 0CDh
701mi_Long_JMP EQU 0EAh
702mi_Long_CALL EQU 09Ah
703mi_Long_RET EQU 0CBh
704
705BREAK <Standard I/O assignments>
706
707stdin EQU 0
708stdout EQU 1
709stderr EQU 2
710stdaux EQU 3
711stdprn EQU 4
712
713BREAK <Xenix subfunction assignments>
714
715open_for_read EQU 0
716open_for_write EQU 1
717open_for_both EQU 2
718
719BREAK <Xenix error codes>
720
721;
722; XENIX calls all return error codes through AX. If an error occurred then
723; the carry bit will be set and the error code is in AX. If no error occurred
724; then the carry bit is reset and AX contains returned info.
725;
726
727no_error_occurred EQU 0 ?
728
729error_invalid_function EQU 1
730error_file_not_found EQU 2
731error_path_not_found EQU 3
732error_too_many_open_files EQU 4
733error_access_denied EQU 5
734error_invalid_handle EQU 6
735error_arena_trashed EQU 7
736error_not_enough_memory EQU 8
737error_invalid_block EQU 9
738error_bad_environment EQU 10
739error_bad_format EQU 11
740error_invalid_access EQU 12
741error_invalid_data EQU 13
742;**** unused EQU 14
743error_invalid_drive EQU 15
744error_current_directory EQU 16
745error_not_same_device EQU 17
746error_no_more_files EQU 18
747
748country_not_found EQU error_file_not_found
749alloc_not_enough_memory EQU error_not_enough_memory
750alloc_arena_trashed EQU error_arena_trashed
751
752close_invalid_handle EQU error_invalid_handle
753close_invalid_function EQU error_invalid_function
754
755chdir_path_not_found EQU error_path_not_found
756
757chmod_path_not_found EQU error_path_not_found
758chmod_access_denied EQU error_access_denied
759chmod_invalid_function EQU error_invalid_function
760
761creat_access_denied EQU error_access_denied
762creat_path_not_found EQU error_path_not_found
763creat_too_many_open_files EQU error_too_many_open_files
764
765curdir_invalid_drive EQU error_invalid_drive
766
767dealloc_invalid_block EQU error_invalid_block
768dealloc_arena_trashed EQU error_arena_trashed
769
770dup_invalid_handle EQU error_invalid_handle
771dup_too_many_open_files EQU error_too_many_open_files
772
773dup2_invalid_handle EQU error_invalid_handle
774
775exec_invalid_function EQU error_invalid_function
776exec_bad_environment EQU error_bad_environment
777exec_bad_format EQU error_bad_format
778exec_not_enough_memory EQU error_not_enough_memory
779exec_file_not_found EQU error_file_not_found
780
781filetimes_invalid_function EQU error_invalid_function
782filetimes_invalid_handle EQU error_invalid_handle
783
784findfirst_file_not_found EQU error_file_not_found
785findfirst_no_more_files EQU error_no_more_files
786findnext_no_more_files EQU error_no_more_files
787
788international_invalid_function EQU error_invalid_function
789
790ioctl_invalid_handle EQU error_invalid_handle
791ioctl_invalid_function EQU error_invalid_function
792ioctl_invalid_data EQU error_invalid_data
793
794lseek_invalid_handle EQU error_invalid_handle
795lseek_invalid_function EQU error_invalid_function
796
797mkdir_path_not_found EQU error_path_not_found
798mkdir_access_denied EQU error_access_denied
799
800open_invalid_access EQU error_invalid_access
801open_file_not_found EQU error_file_not_found
802open_access_denied EQU error_access_denied
803open_too_many_open_files EQU error_too_many_open_files
804
805read_invalid_handle EQU error_invalid_handle
806read_access_denied EQU error_access_denied
807
808rename_file_not_found EQU error_file_not_found
809rename_not_same_device EQU error_not_same_device
810rename_access_denied EQU error_access_denied
811
812rmdir_path_not_found EQU error_path_not_found
813rmdir_access_denied EQU error_access_denied
814rmdir_current_directory EQU error_current_directory
815
816setblock_invalid_block EQU error_invalid_block
817setblock_arena_trashed EQU error_arena_trashed
818setblock_not_enough_memory EQU error_not_enough_memory
819setblock_invalid_function EQU error_invalid_function
820
821unlink_file_not_found EQU error_file_not_found
822unlink_access_denied EQU error_access_denied
823
824write_invalid_handle EQU error_invalid_handle
825write_access_denied EQU error_access_denied
826
827BREAK <system call definitions>
828
829Abort EQU 0 ; 0 0
830Std_Con_Input EQU 1 ; 1 1
831Std_Con_Output EQU 2 ; 2 2
832Std_Aux_Input EQU 3 ; 3 3
833Std_Aux_Output EQU 4 ; 4 4
834Std_Printer_Output EQU 5 ; 5 5
835Raw_Con_IO EQU 6 ; 6 6
836Raw_Con_Input EQU 7 ; 7 7
837Std_Con_Input_No_Echo EQU 8 ; 8 8
838Std_Con_String_Output EQU 9 ; 9 9
839Std_Con_String_Input EQU 10 ; 10 A
840Std_Con_Input_Status EQU 11 ; 11 B
841Std_Con_Input_Flush EQU 12 ; 12 C
842Disk_Reset EQU 13 ; 13 D
843Set_Default_Drive EQU 14 ; 14 E
844FCB_Open EQU 15 ; 15 F
845FCB_Close EQU 16 ; 16 10
846Dir_Search_First EQU 17 ; 17 11
847Dir_Search_Next EQU 18 ; 18 12
848FCB_Delete EQU 19 ; 19 13
849FCB_Seq_Read EQU 20 ; 20 14
850FCB_Seq_Write EQU 21 ; 21 15
851FCB_Create EQU 22 ; 22 16
852FCB_Rename EQU 23 ; 23 17
853Get_Default_Drive EQU 25 ; 25 19
854Set_DMA EQU 26 ; 26 1A
855;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
856; C A V E A T P R O G R A M M E R ;
857; ;
858Get_Default_DPB EQU 31 ; 31 1F
859; ;
860; C A V E A T P R O G R A M M E R ;
861;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
862FCB_Random_Read EQU 33 ; 33 21
863FCB_Random_Write EQU 34 ; 34 22
864Get_FCB_File_Length EQU 35 ; 35 23
865Get_FCB_Position EQU 36 ; 36 24
866Set_Interrupt_Vector EQU 37 ; 37 25
867Create_Process_Data_Block EQU 38 ; 38 26
868FCB_Random_Read_Block EQU 39 ; 39 27
869FCB_Random_Write_Block EQU 40 ; 40 28
870Parse_File_Descriptor EQU 41 ; 41 29
871Get_Date EQU 42 ; 42 2A
872Set_Date EQU 43 ; 43 2B
873Get_Time EQU 44 ; 44 2C
874Set_Time EQU 45 ; 45 2D
875Set_Verify_On_Write EQU 46 ; 46 2E
876; Extended functionality group
877Get_DMA EQU 47 ; 47 2F
878Get_Version EQU 48 ; 48 30
879Keep_Process EQU 49 ; 49 31
880;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
881; C A V E A T P R O G R A M M E R ;
882; ;
883Get_DPB EQU 50 ; 50 32
884; ;
885; C A V E A T P R O G R A M M E R ;
886;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
887Set_CTRL_C_Trapping EQU 51 ; 51 33
888Get_InDOS_Flag EQU 52 ; 52 34
889Get_Interrupt_Vector EQU 53 ; 53 35
890Get_Drive_Freespace EQU 54 ; 54 36
891Char_Oper EQU 55 ; 55 37
892International EQU 56 ; 56 38
893; Directory Group
894MKDir EQU 57 ; 57 39
895RMDir EQU 58 ; 58 3A
896CHDir EQU 59 ; 59 3B
897; File Group
898Creat EQU 60 ; 60 3C
899Open EQU 61 ; 61 3D
900Close EQU 62 ; 62 3E
901Read EQU 63 ; 63 3F
902Write EQU 64 ; 64 40
903Unlink EQU 65 ; 65 41
904LSeek EQU 66 ; 66 42
905CHMod EQU 67 ; 67 43
906IOCtl EQU 68 ; 68 44
907XDup EQU 69 ; 69 45
908XDup2 EQU 70 ; 70 46
909Current_Dir EQU 71 ; 71 47
910; Memory Group
911Alloc EQU 72 ; 72 48
912Dealloc EQU 73 ; 73 49
913Setblock EQU 74 ; 74 4A
914; Process Group
915Exec EQU 75 ; 75 4B
916Exit EQU 76 ; 76 4C
917Wait EQU 77 ; 77 4D
918Find_First EQU 78 ; 78 4E
919; Special Group
920Find_Next EQU 79 ; 79 4F
921; SPECIAL SYSTEM GROUP
922;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
923; C A V E A T P R O G R A M M E R ;
924; ;
925Set_Current_PDB EQU 80 ; 80 50
926Get_Current_PDB EQU 81 ; 81 51
927Get_In_Vars EQU 82 ; 82 52
928SetDPB EQU 83 ; 83 53
929; ;
930; C A V E A T P R O G R A M M E R ;
931;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
932Get_Verify_On_Write EQU 84 ; 84 54
933;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
934; C A V E A T P R O G R A M M E R ;
935; ;
936Dup_PDB EQU 85 ; 85 55
937; ;
938; C A V E A T P R O G R A M M E R ;
939;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
940Rename EQU 86 ; 86 56
941File_Times EQU 87 ; 87 57
942AllocOper EQU 88 ; 88 58
943; Network extention system calls
944GetExtendedError EQU 89 ; 89 59
945CreateTempFile EQU 90 ; 90 5A
946CreateNewFile EQU 91 ; 91 5B
947LockOper EQU 92 ; 92 5C Lock and Unlock
948ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall,
949 ; CloseByName, CloseUser,
950 ; CloseUserProcess,
951 ; GetOpenFileList
952UserIDOper EQU 94 ; 94 5E Get and Set
953AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel
954
955Set_Oem_Handler EQU 248 ; 248 F8
956OEM_C1 EQU 249 ; 249 F9
957OEM_C2 EQU 250 ; 250 FA
958OEM_C3 EQU 251 ; 251 FB
959OEM_C4 EQU 252 ; 252 FC
960OEM_C5 EQU 253 ; 253 FD
961OEM_C6 EQU 254 ; 254 FE
962OEM_C7 EQU 255 ; 255 FF
963SUBTTL