Answer the question
In order to leave comments, you need to log in
How to reverse a string and not letters in words?
Here is the code that reverses the string and the words in it, but how do you reverse the string?
.model tiny
.code
org 100h
start:
MOV CH,0
MOV CL,0
INPUT:
MOV AH,1
INT 21H
CMP AL,13D;compare with enter
JE LINE ; comare if = jump to revers function
AND DX,0 ;zanulaem dla zapisi v stek(pobitovae i)
MOV DL,AL;zanosim simvol
PUSH DX;pushim v stek
INC CL;
JMP INPUT
LINE:;pixaem \n
MOV AH,2
MOV DL,0AH
INT 21H
MOV DL,0DH
INT 21H
PRINT:
POP DX
MOV AH,2
INT 21H
LOOP PRINT
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