Hi everyone,
My purpose is get file name from keyboard then open and write this file in asm. Actually it is first time i interested in this language.
Here is my code
.MODEL SMALL
.DATA
MSG DB 0DH,0AH, ' ENTER THE FILE NAME :-----> : $'
STR1 DB 255 DUP('$')
Buffer DB 10 dup(0)
Handle dw ?
.CODE
BEGIN:
MOV AX,@DATA
MOV DS,AX
LEA DX,MSG
MOV AH,09H
INT 21H
LEA SI,STR1
MOV AH,01H
READ:
INT 21H
MOV [SI],AL
INC SI
CMP AL,0DH
JNE READ
DISPLAY:
LEA DX,STR1
MOV AH,09H
INT 21H
OPENFILE:
mov ah, 3dh
mov al, 0
mov dx, STR1
int 21h
jc cant_open
mov handle, ax
READFILE:
mov ah,3fh
mov bx, handle
lea dx, offset Buffer
mov cx, 10
int 21h
EOF:
mov bx, handle
mov ah, 3eh
int 21h
cant_open:
MOV AX, 4C00H
INT 21H
.EXIT
END BEGIN
I am getting A2070 error on "mov dx, STR1 ;Presume DS points at filename" line. Could you help me?