-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIDOS.MAC
More file actions
1637 lines (1494 loc) · 39.5 KB
/
IDOS.MAC
File metadata and controls
1637 lines (1494 loc) · 39.5 KB
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
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; FILENAME: IDOS.MAC
;
; Copyright (c) 1988 by Borland International, Inc.
;
; DESCRIPTION: This include file contains various macros that may
; be used to communicate with DOS. This include file uses Ideal mode
; syntax. For documentation on each of the macros in this file see the
; file DOSMAC.DOC.
;
; NOTE: In order to use this macro file you must also include the files:
; IMACROS.MAC, KBD.EQU, and DOS.EQU in your module.
;
macro Terminate10Program
DosCall <DOS_PROGRAM_TERMINATE>
endm
macro ReadKBDEcho
DosCall <DOS_READ_KBD_ECHO>
endm
macro CharacterOutput Character
ifb <Character>
display "Caller must provide Character parameter to CharacterOutput."
err
else
mov dl, Character
DosCall <DOS_WRITE_CHARACTER>
endif
endm
macro AuxiliaryInput
DosCall <DOS_AUXILIARY_INPUT>
endm
macro AuxiliaryOutput Character
ifb <Character>
display "Caller must provide Character parameter to AuxiliaryOutput."
err
else
mov dl, <Character>
DosCall <DOS_AUXILIARY_OUTPUT>
endif
endm
macro PrinterOutput Character
ifb <Character>
display "Caller must provide Character parameter to PrinterOutput."
err
else
mov dl, <Character>
DosCall <DOS_PRINTER_OUTPUT>
endif
endm
macro ConsoleIO Value
ifb <Value>
display "Caller must provide the Value parameter to ConsoleIO."
err
else
mov dl, Value
DosCall <DOS_CONSOLE_IO>
endif
endm
macro UnfilteredCharInput
DosCall <DOS_UNFILTERED_INPUT>
endm
macro CharInputNoEcho
DosCall <DOS_CHARACTER_INPUT>
endm
macro WriteString StringSeg, StringOfs
macro ErrMsg
display "You must provide the string address parameters to WriteString."
err
endm
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <StringSeg>, <ds>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
DosCall DOS_WRITE_STRING
endif
endif
endm
macro BufferedInput StringSeg, StringOfs
macro ErrMsg
display "Caller must provide the address parameters to BufferedInput."
err
endm
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
DosCall <DOS_BUFFERED_INPUT>
endif
endif
endm
macro GetInputStatus
DosCall <DOS_GET_INPUT_STATUS>
endm
macro ResetInputBuffer Function, StringSeg, StringOfs
ifb <Function>
display "Caller must provide the Function parameter to ResetInputBuffer."
err
else
ifb <StringSeg>
mov al, Function
else
ifb <StringOfs>
display "Caller must provide the StringOfs parameter to ResetInputBuffer."
err
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
endif
endif
DosCall <DOS_RESET_INPUT>
endif
endm
macro ResetDisk
DosCall <DOS_DISK_RESET>
endm
macro ChangeDrive Drive
ifb <Drive>
display "You must provide the Drive parameter to ChangeDrive."
err
else
mov dl, Drive
DosCall DOS_CHANGE_DISK_DRIVE
endif
endm
macro OpenFCBFile FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to OpenFCBFile."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_OPEN_FCB_FILE>
endif
endif
endm
macro CloseFCBFile FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to CloseFCBFile."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_CLOSE_FCB_FILE>
endif
endif
endm
macro FindFirstFCB FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to FindFirstFCB."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_FIND_FIRST_FCB>
endif
endif
endm
macro FindNextFCB FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to FindNextFCB."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_FIND_NEXT_FCB>
endif
endif
endm
macro DeleteFCBFile FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to DeleteFCBFile."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_DELETE_FCB_FILE>
endif
endif
endm
macro SequentialFCBRead FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to SequentialFCBRead."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_SEQUENTIAL_READ>
endif
endif
endm
macro SequentialFCBWrite FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to SequentialFCBWrite."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_SEQUENTIAL_WRITE>
endif
endif
endm
macro CreateFCBFile FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to CreateFCBFile."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_CREATE_FCB_FILE>
endif
endif
endm
macro RenameFCBFile FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to RenameFCBFile."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_RENAME_FCB_FILE>
endif
endif
endm
macro GetDrive
DosCall <DOS_GET_DISK_DRIVE>
endm
macro SetDTA DTASeg, DTAOfs
macro ErrMsg
display "You must provide the DTASeg:DTAOfs parameters to SetDTA."
err
endm
ifb <DTASeg>
ErrMsg
else
ifb <DTAOfs>
ErrMsg
else
; First check if the parameter is a register. If it is then
; push it and pop the value into ds. If not check if it's a
; constant or variable and act accordingly.
ifidni <ds>, <DTASeg>
; Do nothing
else
LoadSegment <ds>, <DTASeg>
endif
mov dx, DTAOfs ; Get offset of DTA
DosCall DOS_SET_DTA ; Set new DTA address
endif
endif
endm
macro DefaultDiskAllocation
DosCall <DOS_DEFAULT_DRIVE_INFO>
endm
macro DiskAllocation Drive
ifb <Drive>
display "Caller must provide Drive parameter to DiskAllocation."
err
else
mov dl, Drive
DosCall <DOS_DRIVE_INFO>
endif
endm
macro RandomFCBRead FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to RandomFCBRead."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_RANDOM_READ>
endif
endif
endm
macro RandomFCBWrite FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to RandomFCBWrite."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_RANDOM_WRITE>
endif
endif
endm
macro GetFCBFileSize FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to GetFCBFileSize."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_GET_FILE_SIZE>
endif
endif
endm
macro SetFCBFileRecord FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide FCB address to SetFCBFileRecord."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
DosCall <DOS_SET_RECORD_NUMBER>
endif
endif
endm
macro SetVector Vector, VectorSeg, VectorOfs
macro ErrMsg
display "You must provide the Vector, VectorSeg and VectorOfs parameters to SetVector."
err
endm
ifb <Vector>
ErrMsg
else
ifb <VectorSeg>
ErrMsg
else
ifb <VectorOfs>
ErrMsg
else
ifidni <ds>, <VectorSeg>
; Do nothing
else
LoadSegment <ds>, <VectorSeg>
endif
mov dx, VectorOfs
DosCall DOS_SET_VECTOR
endif
endif
endif
endm
macro CreatePSP PSPSeg
ifb <PSPSeg>
display "Caller must provide PSPSeg parameter to CreatePSP."
err
else
mov dx, <PSPSeg>
DosCall <DOS_CREATE_PSP>
endif
endm
macro RandomFCBBlockRead FCBSeg, FCBOfs, Count
macro ErrMsg
display "Caller must provide FCB address to RandomFCBBlockRead."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifb <Count>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
mov cx, Count
DosCall <DOS_RANDOM_BLOCK_READ>
endif
endif
endif
endm
macro RandomFCBBlockWrite FCBSeg, FCBOfs, Count
macro ErrMsg
display "Caller must provide FCB address to RandomFCBBlockWrite."
err
endm
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
ifb <Count>
ErrMsg
else
ifidni <ds>, <FCBSeg>
; Do nothing
else
LoadSegment <ds>, <FCBSeg>
endif
mov dx, FCBOfs
mov cx, Count
DosCall <DOS_RANDOM_BLOCK_WRITE>
endif
endif
endif
endm
macro ParseFCBFilename Flags, FilenameSeg, FilenameOfs, FCBSeg, FCBOfs
macro ErrMsg
display "Caller must provide the Flags and address parameters to ParseFCBFilename."
err
endm
ifb <Flags>
ErrMsg
else
ifb <FilenameSeg>
ErrMsg
else
ifb <FilenameOfs>
ErrMsg
else
ifb <FCBSeg>
ErrMsg
else
ifb <FCBOfs>
ErrMsg
else
LoadSegment <es>, <FCBSeg>
mov di, FCBOfs
LoadSegment <ds>, <FilenameSeg>
mov si, FilenameOfs
mov al, Flags
DosCall <DOS_PARSE_FILENAME>
endif
endif
endif
endif
endif
endm
macro GetDate
DosCall <DOS_GET_DATE>
endm
macro SetDate Year, Month, Day
macro ErrMsg
display "Caller must provide Year, Month and Day parameters to SetDate."
err
endm
ifb <Year>
ErrMsg
else
ifb <Month>
ErrMsg
else
ifb <Day>
ErrMsg
else
mov cx, Year
mov dh, Month
mov dl, Day
DosCall <DOS_SET_DATE>
endif
endif
endif
endm
macro GetTime
DosCall <DOS_GET_TIME>
endm
macro SetTime Hour, Minute, Second, Hundredth
macro ErrMsg
display "Caller must provide Hour, Minute, Second and Hundredth parameters to SetTime."
err
endm
ifb <Hour>
ErrMsg
else
ifb <Minute>
ErrMsg
else
ifb <Second>
ErrMsg
else
ifb <Hundredth>
ErrMsg
else
mov ch, Hour
mov cl, Minute
mov dh, Second
mov dl, Hundredth
DosCall <DOS_SET_TIME>
endif
endif
endif
endif
endm
macro SetVerifyFlag Flag
ifb <Flag>
display "Caller must provide Flag parameter to SetVerifyFlag."
err
else
xor dl, dl
mov al, Flag
DosCall <DOS_SET_VERIFY_FLAG>
endif
endm
macro GetDTA
DosCall DOS_GET_DTA
endm
macro GetDOSVersion
DosCall DOS_GET_DOS_VERSION
endm
macro TSR Result, Paragraphs
macro ErrMsg
display "Caller must provide Result and Paragraphs parameters to TSR."
err
endm
ifb <Result>
ErrMsg
else
ifb <Paragraphs>
ErrMsg
else
mov al, Result
mov dx, Paragraphs
DosCall <DOS_KEEP>
endif
endif
endm
macro GetSetBREAK Mode, Value
ifb <Mode>
display "Caller must provide Mode and optionally Value parameters to GetSetBREAK."
err
else
ifnb <Value>
mov dl, Value
endif
mov al, Mode
DosCall <DOS_GET_SET_CTRL_BREAK>
endif
endm
macro GetVector Interrupt
ifb <Interrupt>
display "Caller must provide Interrupt parameter to GetVector."
err
else
mov al, Interrupt
DosCall <DOS_GET_VECTOR>
endif
endm
macro GetDiskSpace Disk
ifb <Disk>
display "Caller must provide Disk parameter to GetDiskSpace."
err
else
mov dl, Disk
DosCall <DOS_GET_DISK_SPACE>
endif
endm
macro GetSetCountryInfo BufferSeg, BufferOfs, ShortCode, LongCode
macro ErrMsg
display "Caller must provide the buffer address and country code parameters"
display "to GetSetCountryInfo."
err
endm
ifb <BufferSeg>
ErrMsg
else
ifb <BufferOfs>
ErrMsg
else
ifb <ShortCode>
ErrMsg
else
ifnb <LongCode>
mov bx, LongCode
endif
mov al, ShortCode
LoadSegment <ds>, <BufferSeg>
mov dx, BufferOfs
DosCall <DOS_GET_SET_COUNTRY>
endif
endif
endif
endm
macro CreateDir StringSeg, StringOfs
macro ErrMsg
display "You must provide address parameters to CreateDir."
err
endm
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
DosCall DOS_MAKE_DIRECTORY
endif
endif
endm
macro RemoveDir StringSeg, StringOfs
macro ErrMsg
display "You must provide address parameters to RemoveDir."
err
endm
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
DosCall DOS_DELETE_DIRECTORY
endif
endif
endm
macro ChangeDirectory StringSeg, StringOfs
macro ErrMsg
display "You must provide the segment and offset of the new path to ChangeDirectory."
err
endm
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs ; Store the offset of the
DosCall DOS_SET_CURRENT_DIR ; new path
endif
endif
endm
macro CreateFile Attributes, StringSeg, StringOfs
macro ErrMsg
display "You must provide Attributes and address parameters to CreateFile."
err
endm
ifb <Attributes>
ErrMsg
else
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
mov cx, Attributes
DosCall DOS_CREATE_FILE
endif
endif
endif
endm
macro OpenFile AccessMode, StringSeg, StringOfs
macro ErrMsg
display "You must provide AccessMode and address parameters to OpenFile."
err
endm
ifb <AccessMode>
ErrMsg
else
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
mov al, AccessMode
DosCall DOS_OPEN_FILE
endif
endif
endif
endm
macro CloseFile Handle
ifb <Handle>
display "You must provide a file handle to CloseFile."
err
else
mov bx, Handle
DosCall DOS_CLOSE_FILE
endif
endm
macro ReadFile Handle, Count, StringSeg, StringOfs
macro ErrMsg
display "You must provide Handle, Count and address parameters to ReadFile."
err
endm
ifb <Handle>
ErrMsg
else
ifb <Count>
ErrMsg
else
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
mov cx, Count
mov bx, Handle
DosCall DOS_READ_FROM_HANDLE
endif
endif
endif
endif
endm
macro WriteFile Handle, Count, StringSeg, StringOfs
macro ErrMsg
display "You must provide Handle, Count and address parameters to WriteFile."
err
endm
ifb <Handle>
ErrMsg
else
ifb <Count>
ErrMsg
else
ifb <StringSeg>
ErrMsg
else
ifb <StringOfs>
ErrMsg
else
ifidni <ds>, <StringSeg>
; Do nothing
else
LoadSegment <ds>, <StringSeg>
endif
mov dx, StringOfs
mov cx, Count
mov bx, Handle
DosCall DOS_WRITE_TO_HANDLE
endif
endif
endif
endif
endm
macro DeleteFile StringSeg, StringOfs
macro ErrMsg
display "You must provide address parameters to OpenFile."
err