I want to know just to go from here; I've got to return whether a paticular word is found or not in a text file.
I've got this so far, just having problems finishing it off, can anyone help?
By the way the word will be specified by the user.
I've got this so far, just having problems finishing it off, can anyone help?
By the way the word will be specified by the user.
Code:
JMP START ; Skip over the message
;The message and string terminator
welmsg: DB 'Please enter a word to search for and then press enter$'
correctmsg: DB 'Your word was found successfully$'
incorrectmsg: DB 'Your search returned no results$'
filename: DB 'asmtext.ASM',0
Buffer: DB 146 DUP(?) ;data buffer
START:
MOV AH,3DH ; Open file
MOV AL,0 ; Open for reading
MOV DX,filename
INT 21h ; Calls DOS
MOV BX,AX ; save file handle in BX
MOV AH,3FH ; Function to read
MOV CX,146 ; Number of bytes to read
MOV DX,Buffer
MOV ah,1h
mov DH, al
mov ah, 1h
MOV AH,0AH
INT 21h
FINISH:
MOV AH,3EH ; Close File
INT 21H
MOV AH, 4Ch ; MS-DOS function-number for successful exit
INT 21h ; go back to the operating system