-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOS.ASM
70 lines (56 loc) · 813 Bytes
/
DOS.ASM
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
%MACRO WRITESOUT 0
MOV AH, 09h
INT 21h
%ENDMACRO
%MACRO FLUSH 0
MOV AX, 0C00h
INT 21h
%ENDMACRO
%MACRO QUIT_PROC 0
MOV AX, 4C00h
INT 21h
%ENDMACRO
%MACRO GETSTDINSTATUS 0
MOV AH, 0Bh
INT 21h
%ENDMACRO
%MACRO READCIN 0
MOV AH, 1
INT 21h
%ENDMACRO
%MACRO WRITECOUT 0
MOV AH, 02h
INT 21h
%ENDMACRO
%DEFINE WORDSZ 2
%DEFINE ASCII_RETURN 0Dh
%DEFINE ASCII_NEWLINE 0Ah
%DEFINE F_READ 0
%DEFINE F_WRITE 1
%DEFINE F_READ_WRITE 2
;; DX - null-terminated file name
;; AL - flags
%MACRO OPENF 0
MOV AH, 3Dh
INT 21h
%ENDMACRO
%MACRO READF 0
MOV AH, 3Fh
INT 21h
%ENDMACRO
%MACRO WRITEF 0
MOV AH, 40h
INT 21h
%ENDMACRO
%MACRO CLOSEF 0
MOV AH, 3Eh
INT 21h
%ENDMACRO
%MACRO CREATF 0
MOV AH, 3Ch
INT 21h
%ENDMACRO
%MACRO SEEKF 0
MOV AH, 42h
INT 21h
%ENDMACRO