在以下代码中,我能够反转字符串,但我不知道如何在此代码中添加函数以获得以下结果:
输入 AbCDeF_XYz 输出:Zyx_fEdcBa
name "REVERSE"
include "emu8086.inc"
print "Enter a string:"
MOV DX,11
CALL get_string
printn
MOV DI,0x0
ReadString:
MOV AL,[ds+di]
CMP AL,0x0
JE Reverse
INC DI
PUSH AX
JMP ReadString
Reverse:
POP AX
MOV AH,0xE
INT 0x10
CMP AL,0x0
JNE Reverse
HLT
DEFINE_GET_STRING
END