Hello, I am trying to find why is my code in assembly not compiling. I am a beginner in this language and I don’t seem to know the problem.
DELETE SEGMENT
assume cs:DELETE, ds:DELETE, ss:DELETE
org 0100h
.model small
.stack 100h
.DATA
filename db ‘FILE1.txt’, 0
success_msg db ‘File deleted successfully’, 0DH, 0Ah, ‘$’
error_msg db ‘File deletion unsuccessful’, 0DH, 0Ah, ‘$’
.CODE
Start:
mov ax, @DATA
mov ds, ax
; Call DOS function to delete file
mov ah, 41h
lea dx, filename
int 21h
; Check for error
jc error
; Display success message
mov ah, 09h
lea dx, success_msg
int 21h
jmp exit
error:
; Display error message
mov ah, 09h
lea dx, error_msg
int 21h
exit:
mov ah, 4Ch
int 21h
DELETE ENDS
END Start
New contributor
Michael Bryan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.