1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
|
#type ("17.klein")#
prefix of extended fcb:
offset size name
-7 1 flag byte 255
-6 5 reserved
-1 1 attribute byte 2=hidden file, 4=system file
normal fcb format:
offset size name
0 1 drive number 0=default (for open), 1=A, 2=B
1 8 filename 8 chars, left aligned and padded
(if necessary) with blanks
9 3 extension 3 chars, left aligned and padded
(if necessary) with blanks
12 2 current block pointer to the block of 128 records
containing the current record
(0 after open)
14 2 record size logical record size in bytes
(128 after open, changed eventually)
16 4 file size file size in bytes (1. byte low)
20 2 date of last write 20:mmmddddd 21:yyyyyyym
22 2 time of last write 22:mmmsssss 23:hhhhhmmm
24 8 reserved
32 1 current record pointer to one of the 128 records in
the block (not initialized by open)
must be set before sequential read/write
33 4 relative record pointer to selected record
(counting from the beginning of file by 0)
not initialized by open
must be set before sequential read/write
record size less than
64 bytes: both words used
else only first 3 bytes
fields of directory entry:
offset size name
0 8 filename 8 chars, left aligned and padded
(if necessary) with blanks
special use of first byte:
0 : end of allocated directory
229: free directory entry
8 3 extension 3 chars, left aligned and padded
(if necessary) with blanks
11 1 attributes 1: read only file
2: hidden file
4: system file
8: entry is the volume's id
16: entry is subdirectory's name
32: archive bit (set, when written to)
12 10 reserved
22 2 time of last write 22:mmmsssss 23:hhhhhmmm
24 2 date of last write 24:mmmddddd 25:yyyyyyym
26 2 reserved
28 4 file size file size in bytes (1. byte low)
directory structure:
- the root directory has a fixed number of entries
- entries that represent a subdirectory have a special attribute in their
entry set
- the subdirectories are themselves files which records are of the same type
as those in the root directory
- the number of entries in subdirectories are not limited
- the length of a path to a subdirectory is not limited
application of the directory entry fields on subdirectory entries:
volume id : present at root, only one entry has this attribute
directory : the directory entry represents itself an directory
read only : meaningless
archive : meaningless
hidden/system: prevents directories from beeing found, function $3B
will still work
ms-dos interrupts:
$20 : program terminate
call:
CS: segment address
terminates process, returns control to parent process,
file handles are closed, disk cache cleaned, file buffers flushed
programm terminate, alt-c and critical error addresses are restored
new programs should use function $4C
$21 : function request
call:
AH: function number
other registers dependent on function
$22 to $24 :
address locations for msdos use
can be changed by function $25
$22 : terminate address
$23 : alt-c exit address
address of an alt-c routine
$24 : fatal error abort address
address of the error handler
BP:SI can contain further information
not called if error occurs during absolute disk operations (int $25,$26)
$25 : absolute disk read
call:
AL: drive number
DS:BX: disk transfer address
CX: number of sectors
DX: beginning relative sector
return:
CF: 0=successful
1=unsuccessful
AL: error code if unsuccessful
$26 : absolute disk write
call:
AL: drive number
DS:BX: disk transfer address
CX: number of sectors
DX: beginning relative sector
return:
CF: 0=successful
1=unsuccessful
AL: error code if unsuccessful
$27 : terminate but stay resident
call:
CS:DX: first byte following the code
new programms should use function $31
ms-dos function requests:
$00 : terminate program
call:
AH: $00
CS: segment of programm prefix
$01 : read keyboard and echo
call:
AH: $01
return:
AL: character typed
waits for input, echos and returns it
alt-c will call interrupt
$02 : display character
call:
AH: $02
DL: character to be displayed
alt-c will call interrupt
$03 : auxiliary input
call:
AH: $03
return:
AL: character from auxiliary device
waits for input, alt-c will call interrupt
$04 : auxiliary output
call:
AH: $04
DL: character to output
alt-c will call interrupt
$05 : print character
call:
AH: $05
DL: character for printer
alt-c will call interrupt
$06 : direct console i/o
call:
AH: $06
DL: $FF: check for keyboard input
otherwise: display DL on screen
return:
ZF: 0=no char available
1=char was read
AL: char if read
$07 : direct konsole input
call:
AH: $07
return:
AL: character from keyboard
waits for character
$08 : read keyboard
call:
AH: $08
return:
AL: character from keyboard
waits for character, alt-c will call interrupt
$09 : display string
call:
AH: $09
DS:DX: string, ending with '$'
$0A : buffered keyboard input
call:
AH: $0A
DS:DX: input buffer
byte 1: maximum number of chars in buffer (with CR)
2: actual number of chars in buffer (set by function)
3-n: must be at least as long as the max
waits for chars, allows editing, ignores overflow,
alt-c will call interrupt
$0B : check keyboard status
call:
AH: $0B
return:
AL: 0=no chars in type-ahead buffer
255=chars available
$0C : flush buffer and read keyboard
call:
AH: $0C
AL: $01,$06,$07,$08 or $0A: corresponding function is called
other values: no further processing
return:
AL: 0=type ahead buffer was flushed, no processing performed
$0D : disk reset
call:
AH: $0D
all disk buffers are flushed, no directory updates performed
$0E : select disk
call:
AH: $0E
DL: drive number, 1=A, 2=B, ..
return:
AL: number of logical drives
$0F : open file
call:
AH: $0F
DS:DX: unopened fcb
return:
AL: 0=directory entry found
if drive code was 0, it is set to the default
current block is set to 0
record size is set to 128
file size, time and date of last modification are set
from directory
the default record size must be set, if not 128
before performing a sequential (random) operation,
current record (relative record) field must be set
255=no directory entry found
$10 : close file
call:
AH: $10
DS:DX: opened fcb
return:
AL: 0=directory entry found
255=no directory entry found
$11 : search for first entry
call:
AH: $11
DS:DX: unopened fcb
return:
0=directory entry found
fcb (normal or extended) is created
at the disk transfer address
255=no directory entry found
to search for hidden or system files, the fcb must be extended
see notes on search attributes
$12 : search for next entry
call:
AH: $12
DS:DX: unopened fcb
return:
AL: 0=directory entry found
fcb (normal or extended) is created
at the disk transfer address
255=no directory entry found
the fcb must be one used previously in a call to $11
$13 : delete file
call:
AH: $13
DS:DX: unopened fcb
return:
AL: 0=directory entry found
255=no directory entry found
deletes all files with matching names
$14 : sequential read
call:
AH: $14
DS:DX: opened fcb
return:
AL: 0=read completed successfully
1=eof, no data in the record
2=dta too small, not enough space to read without exceeding
the segment boundaries, read cancelled
3=eof, partial record was read and padded to the record
length with zeros
the record pointed to by the current block and current record
is loaded to the disk transfer address and the fields are incremented
$15 : sequential write
call:
AH: $15
DS:DX: opened fcb
return:
AL: 0=write completed successfully
1=disk full, write canceled
2=dta too small to write one record without exceeding the
segment boundaries, write canceled
the record pointed to by the current block and current record
are written from the disk transfer address and the fields are incremented
$16 : create file
call:
AH: $16
DS:DX: unopened fcb
return:
AL: 0=empty directory entry found
255=no empty entry available and file didn't exist before
if the file does already exist, it is made a zero length file
else it is created if an empty entry is found
$17 : rename file
call:
AH: $17
DS:DX: modified fcb
return:
AL: 0=directory entry found
255=no directory entry found or destination already exists
the fcb must contain the search file name and another file name
at offset $11
$19 : current disk
call:
AH: $19
return:
AL: selected drive (0=A, 1=B, .. )
$1A : set disk transfer address
call:
AH: $1A
DS:DX: disk transfer address
default is $80 in the psp
$21 : random read
call:
AH: $21
DS:DX: opened fcb
return:
0=read completed successfully
1=eof, no data read
2=dta too small, read canceled
3=eof, partial record, padded with zeros
the current block and current record fields are set to match the
relative record field, then the record is loaded
$22 : random write
call:
AH: $22
DS:DX: opened fcb
return:
AL: 0=write completed successfully
1=disk full
2=dta too small, read canceled
$23 : file size
call:
AH: $23
DS:DX: unopened fcb
return:
AL: 0=directory entry found
the relative record field is set to the number
of records in the file
255=no directory entry found
the record size field must be set
$24 : set relative record
call:
AH: $24
DS:DX: opened fcb
the relative record field is set to the same record as the current block
an the current record field
$25 : set vector
call:
AH: $25
AL: interrupt number
DS:DX: interrupt handling routine
$27 : random block read
call:
AH: $27
DS:DX: opened fcb
CX: number of blocks to read
return:
AL: 0=read completed successfully
1=eof, no data read
2=end of segment, read canceled
3=eof, partial record, padded with zeros
CX: number of blocks read
the reading starts at the relative record
the current block, current record and relative record field are updated
$28 : random block write
call:
AH: $28
DS:DX: opened fcb
CX: number of records to write
0=set file size
the file size field of thedirectory entry is set to the number
of records specified by the relative record field
return:
AL: 0=write completed successfully
1=disk full, no records written
2=end of dta-segment, read canceled
CX: number of blocks written
the writing starts at the relative record
the current block, current record and relative record field are updated
$29 : parse file name
call:
AH: $29
AL: controls parsing
bit 0: if file separators are encountered
(: . ; , = + / " [ ] \ < ] | blank tab)
0: all parsing stops
1: leading separators are ignored
bit 1: if the string does not contain a drive letter
0: the fcb drive number is set to 0 (default)
1: the fcb drive number is not changed
bit 2: if the string does not contain a filename
0: the fcb filename is set to 8 blanks
1: the fcb filename is not changed
bit 3: if the string does not contain an extension
0: the fcb extension is set to three blanks
1: the fcb extension is not changed
DS:SI: string to parse
filename terminators include all filename separators
plus any control character
ES:DI: if the string contained a valid filename,
it points to an unopened fcb
else ES:DI+1 points to a blank
return:
AL: 0=no wild card characters
1=wild card characters used
255=drive letter invalid
DS:SI: first byte past string that was parsed
if the filename contains an asterisk,
all folowing letters are set to question mark
ES:DI: unopened fcb
if filename is found, an unopened fcb is created here
$2A : get date
call:
AH: $2A
return:
CX: year (1980-2099)
DH: month (1-12)
DL: day (1-31)
AL: day of week (0=sun, .., 6=sat)
$2B : set date
call:
AH: $2B
CX: year (1980-2099)
DH: month (1-12)
DL: day (1-31)
return:
AL: 0=date was valid
255=date was invalid
$2C : get time
call:
AH: $2C
return:
CH: hour (0-23)
CL: minutes (0-59)
DH: seconds (0-59)
DL: hundredths (0-99)
$2D : set time
call:
AH: $2D
CH: hour (0-23)
CL: minutes (0-59)
DH: seconds (0-59)
DL: hundredths (0-99)
return:
AL: 0=time was valid
255=time was invalid
$2E : set/reset verify flag
call:
AH: $2E
AL: 0=do not verify
1=verify
$2F : get disk transfer address
call:
AH: $2F
return:
ES:BX: points to disk transfer address
$30 : get dos version number
call:
AH: $30
return:
AL: major version number
AH: minor version number
$31 : keep process
call:
AH: $31
AL: exit code
DX: memory size in paragraphs
attemts to set the initial allocation block to a specific size
in paragraphs, will not free up other allocation blocks belonging
to that process, the exit code is available via function $4D
$33 : alt-c check
call:
AH: $33
AL: function
0=request current state
1=set state
DL: if setting
0=off
1=on
return:
AL: 255=al parameter was not in range 0..1
DL: if requesting current state
0=off
1=on
if check is on, every system call executes the check,
else only the device operations
$35 : get interrupt vector
call:
AH: $35
AL: interrupt number
return:
ES:BX: pointer to interrupt routine
$36 : get disk free space
call:
AH: $36
DL: drive (0=default, .....)
return:
BX: available clusters
DX: clusters per drive
CX: bytes per sector
AX: $FFFF=drive number invalid
otherwise sectors per cluster
$38 : return country-dependent information
call:
AH: $38
DS:DX: pointer to 32 byte memory area
area format:
size name
2 date/time format
0=usa standard h:m:s m/d/y
1=europe standard h:m:s d/m/y
2=japan standard y/m/d h:m:s
5 asciz currency symbol
2 asciz thousands separator
2 asciz decimal separator
2 asciz date separator
2 asciz time separator
1 bit field
bit 0: 0=currency symbol precedes amount
1=symbol comes after amount
bit 1: 0=symbol immediately precedes the amount
1=space between symbol and amount
1 currency places
figures after decimal point of currency amounts
1 time format
0=12 hour time
1=24 hour time
4 case mapping call
FAR procedure performs country-specific
lower- to uppercase mapping
2 asciz data list separator
if dx=-1 and the country code in AL is found,
the current country is set accordingly
AL: function code
0=current country
or country code (usually international telephone prefix)
must be 0 in msdos 2.0 (only fully implemented after 2.01)
return:
CARRY: 1
AX: 2=file not found
CARRY: 0
DS:DX: filled with country data
$39 : create subdirectory
call:
AH: $39
DS:DX: pointer to pathname (asciz)
return:
CARRY: 1
AX: 3=path not found
5=access denied
no room in parent,
directory already exists or device was specified
CARRY: 0=no error
$3A : remove a directory entry
call:
AH: $3A
DS:DX: pointer to pathname (asciz)
return:
CARRY: 1
AX: 3=path not found
5=access denied
directory not empty, not a directory, root directory
16=current directory
CARRY: 0=no error
$3B : change the current directory
call:
AH: $3B
DS:DX: pointer to pathname (asciz)
return:
CARRY: 1
AX: 3=path not found
CARRY: 0=no error
$3C : create a file
call:
AH: $3C
DS:DX: pointer to pathname
CX: file attribute
return:
CARRY: 1
AX: 3=path not found
4=too many open files
file was created, but no room for handle
5=access denied
uncreatable attribute (directory or volume id),
a file with a more inklusive attribute set exists,
or a directory with the same name exists
CARRY: 0
AX is handle number
handle is open for read/write
creates a new file or truncates existing to length 0
$3D : open a file
call:
AH: $3D
DS:DX: pointer to pathname (asciz)
AL: access
0=open for reading
1=open for writing
2=open for both
return:
CARRY: 1
AX: 2=file not found
4=too many open files
no file handles available
5=access denied
attempted to open a directory, volume id or
a read only file for writing
12=invalid access
AL was not in range 0..2
CARRY: 0
AX is handle number
read/write pointer is set to the first byte of the file
and the record size is set to 1
the returned file handle must be used in subsequent operations
$3E : close a file handle
call:
AH: $3E
BX: file handle
return:
CARRY: 1
6=invalid handle (not currently open)
CARRY: 0=no error
the associated file is closed, buffers are flushed
$3F : read from file/device
call:
AH: $3F
DS:DX: pointer to buffer
CX: bytes to read
BX: file handle
return:
CARRY: 1
AX: 5=access denied
not opened for read
6=invalid handle (not currently open)
CARRY: 0
AX: number of bytes read
0=eof
$40 : write to file/device
call:
AH: $40
DS:DX: pointer to buffer
CX: bytes to write
if 0, the file size is set to the current position
BX: file handle
return:
CARRY: 1
AX: 5=access denied
6=invalid handle
CARRY: 0
AX: number of bytes written
is error if not the same number as requested
$41 : delete a directory entry
call:
AH: $41
DS:DX: pointer to pathname
return:
CARRY: 1
AX: 2=file not found
5=access denied
directory or read only
CARRY: 0=no error
$42 : move file pointer
call:
AH: $42
CX:DX: distance to move, in bytes
AL: method of moving
0=move pointer to offset from beginning of file
1=move to offset from current location
2=move to offset from eof
BX: file handle
return:
CARRY: 1
AX: 1=invalid function
AL not in range 0..2
6=invalid handle
CARRY 0:
DX:AX: new pointer location
moves the read/write file pointer
$43 : change attributes
call:
AH: $43
DS:DX: pointer to pathname (asciz)
AL: function
0=return in CX
1=set to CX
CX: if AL=1
attribute to be set
return:
CARRY: 1
AX: 1=invalid function
AL not in range 0..1
3=path not found
5=access denied
CX contained attributes that can not be changed
(directory, volume id)
CARRY: 0
if AL=0
CX: attributes
$44 : i/o control for devices
call:
AH: $44
BX: handle
BL: (for calls AL=4, 5) drive: 0=default, ..
DS:DX: data or buffer
CX: bytes to read or write
AL: function code
calls 0,1: bits of DX (DH must be 0 on a set call)
0: iscin
1: iscot
2: isnul
3: isclk
4: specl
5: raw
6: eof
7: isdev
8-13: reserved
14: ctrl
15: res
if isdev=0 then channel is a disk file
eof: 0=channel has been written
bits 0-5 are block device number for the channel
(0=a, 1=b, ..)
if isdev=1 then channel is device
eof : 0=end of file on input
raw : 0=this device is cooked
1=device in raw mode
isclk: 1=clock
isnul: 1=nul
iscot: 1=console output
iscin: 1=console input
specl: 1=device is special
ctrl : 0=device can not do control strings
via calls 2,3
1=can do control
0=get device information (returned in DX)
1=set device information (according to DX)
calls 2,5: arbitrary control strings sent or received
to or from a device
call syntax is the same as in read/write calls,
except for 4 and 5, which take drive number in BL
instead of a handle in BX
an invalid function error is returned, if
the ctrl bit is 0
2=read CX number of bytes to DS:DX from device control channel
3=write CX number of bytes from DS:DX to device control channel
4=read CX number of bytes to DS:DX from device control channel
drive number in BL (0=default, ..)
5=write CX number of bytes from DS:DX to device control channel
drive number in BL (0=default, ..)
calls 6,7: check, if a file handle is ready for i/o
intended for status of handles associated with
devices, but checks of file handles are allowed
and defined: input: always ready (255), until eof
then always not ready (0)
output: always ready
6=get input status
7=get output status
return:
CARRY: 1
AX: 1=invalid function
5=access denied
6=invalid handle
13=invalid data
CARRY: 0
AL: 2,3,4,5
AX: count transferred
AL: 6,7
0=not ready
255=ready
sets or gets device information associated with an open handle
or sends or receives a control string to or from a device handle or device
if the function is used for files, only functions 0,6,7 are defined
$45 : duplicate a file handle
call:
AH: $45
BX: file handle
return:
CARRY: 1
AX: 4=too many files open
6=invalid handle
CARRY: 0
AX: new file handle
retruns a new handle that refers to the same file
$46 : force a duplicate of a handle
call:
AH: $46
BX: existing file handle
CX: new file handle
return:
CARRY: 1
AX: 4=too many open files
6=invalid handle
CARRY: 0=no error
CX then refers to the same file as BX, eventually, CX is closed first
$47 : return text of current directory
call:
AH: $47
DS:SI: pointer to 64 byte area
DL: drive number (0=default, ..)
return:
CARRY: 1
AX: 15=invalid drive
CARRY: 0=no error
the path name does not contain the leading separators
$48 : allocate memory
call:
AH: $48
BX: size of memory to be allocated
return:
CARRY: 1
AX: 7=arena trashed
internal consistency has been destroyed
8=not enough memory
BX: maximum size that could be allocated
CARRY: 0
AX:0: pointer to the allocated memory
$49 : free allocated memory
call:
AH: $49
ES: segment address of memory area to be freed
return:
CARRY: 1
AX: 7=arena trashed
internal consistency has been destroyed
9=invalid block
the block was not allocated by $49
CARRY: 0=no error
returns a piece of memory to the system pool that was allocated with $49
$4A : modify allocated memory blocks
call:
AH: $4A
ES: segment address of memory area
BX: requested memory area
return:
CARRY: 1
AX: 7=arena trashed
internal consistency has been destroyed
8=not enough memory
9=invalid block
the block was not allocated by $49
BX: maximum size possible
CARRY: 0=no error
attempts to grow or shrink an allocated block
$4B : load and execute a program
call:
AH: $4B
DS:DX: pointer to pathname (asciz)
ES:BX: pointer to parameter block
for AL=0:
size name
2 segment address of environment
4 pointer to command line at $80
4 pointer to default fcb to be passed at $5C
4 pointer to default fcb to be passed at $6C
for AL=3:
size name
2 segment address where file will be loaded
2 relocation factor to be applied to the image
AL: 0=load and execute
3=load (overlay)
return:
CARRY: 1
AX: 1=invalid function
AL was not in range 0,3
2=file not found
8=not enough memory
10=bad environment
larger than 32K
11=bad format
EXE file contained inconsistent information
CARRY: 0=no error
all open files of a parent are copied to the child process
also inherited is an environment (block of text strings less than 32K)
a zero environment address causes the child to inherit then parents
environment unchanged
$4C : terminate process
call:
AH: $4C
AL: return code
$4D : retrieve then return code of a child
call:
AH: $4D
return:
AX: exit code
high byte: 0=terminate/abort
1=alt-c
2=hard error
3=terminate and stay resident
returns code only once
$4E : find match file
call:
AH: $4E
DS:DX: pointer to pathname
CX: search attributes
return:
CARRY: 1
AX: 2=file not found
18=no more files
CARRY: 0=no error
data block is written to current dma address:
size name
21 reserved for subsequent calls
1 attribute found
2 time
2 date
2 low(size)
2 high(size)
13 packed name
subsequent calls: see $4F
$4F : step through a directory matching files
call:
AH: $4F
return:
CARRY: 1
AX: 18=no more files
CARRY: 0=no error
only used for subsequent calls after $4E
dma address must point to the parablock
$54 : return current setting of verify after write flag
call:
AH: $54
return:
current verify flag value
$56 : move a directory entry
call:
AH: $56
DS:DX: pointer to pathname of existing file
ES:DI: pointer to new pathname
return:
CARRY: 1
AX: 2=file not found
5=access denied
path is directory or new file exists
or directory entry could not be created
17=not same device
CARRY: 0=no error
attempts to rename a file in the directory of one device
$57 : get/set date/time of file
call:
AH: $57
AL: 0=get date and time
1=set date and time
BX: file handle
CX: if AL=1
time to be set
DX: if AL=1
date to be set
return:
CARRY: 1
AX: 1=invalid function
6=invalid handle
CARRY: 0=no error
CX: if AL=0
time
DX: if AL=0
date
date and time are not recorded until file is closed
|