Answer the question
In order to leave comments, you need to log in
Why is this program not working?
Masm ms-dos. The program should output the input string. The line output interrupt does not work, although the ah and dx registers contain the correct values.
assume cs:codeseg, ds:codeseg
codeseg segment
start:
main proc
xor dx, dx
mov ax, codeseg
mov ds, ax
call input
call output
jmp end_prog
main endp
input proc
mov ah, 0ah
lea dx, bufer
int 21h
ret
input endp
output proc
; добавить знак доллара в конец строки
xor bx, bx
mov bl, byte ptr [len]
lea si, [text + bx]
mov byte ptr [si], 24h
; вывод строки
mov ah, 09h
lea dx, text
int 21h
ret
output endp
end_prog:
mov ah, 4ch
int 21h
bufer label byte
max db 20
len db 00
text db 32 dup(0)
codeseg ends
end start
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question