Answer the question
In order to leave comments, you need to log in
How to invert a string in tasm?
you need to enter a string and invert it.
what I have is not working. What could be the problem?
Text segment
assume CS:text,DS:data
Begin: mov AX, data
mov DS, AX
mov BX, offset txt
mov SI,0
inpt: mov Ah, 01h
int 21h
cmp AL,0
je ex_ascii
mov [BX][SI],AL
inc SI
jmp inpt
ex_ascii: mov AH, 08h
int 21h
cmp AL, 10h
je output
jmp inpt
output: mov DX, offset message
mov AH, 09h
int 21h
dec SI
next: cmp SI,0
jl exit
mov DL, [BX][SI]
mov AH, 02h
int 21h
dec SI
jmp next
exit: mov AX, 4c00h
int 21h
text ends
data segment
message db 10, 13,'$'
txt db 80 dup (?)
data ends
end Begin
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