-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFILEMAN.asm
More file actions
executable file
·36 lines (30 loc) · 860 Bytes
/
FILEMAN.asm
File metadata and controls
executable file
·36 lines (30 loc) · 860 Bytes
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
;FILEMAN.asm
;Shoaib Ahmed
;14.10.15
;Open a file and display its contents
assume cs:code,ds:data
data segment
fname db "testf2.txt"
buff db 100 dup(?),"$"
data ends
code segment
START: MOV ax,data
MOV ds,ax
MOV ah,3dh
LEA dx,fname ;pointer to the file name
MOV al,00 ;read only attribute
INT 21h ;On finding pointer to file in AX register, if not found error in AL
MOV bx,ax
MOV ah,3fh ;reading content from file
MOV cx,100d
LEA dx,buff ;storing characters inbuffer
INT 21h
MOV ah,3eh ;close file
INT 21h
LEA dx,buff
MOV ah,9h
INT 21h
MOV ah,4ch
INT 21h
code ends
end START