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