2
我正在为我的计算机体系结构类的任务,我不明白大会。我应该从键盘上输入一个字符串,并检查它是否是回文。我不允许使用INT 21h
。我编写的程序为db string value
而不是键盘输入,但我仍然无法让我的CMP
正常工作。我很确定我做错了。希望有人能帮助。检查字符串回文没有INT 21h在em 8086
#make_COM#
include emu8086.inc
org 100h
jmp init
msg db "kayak",0
init:
Mov SI,5
mov di,0
start:
mov al,msg[si]
dEC si
inc di
mov ah ,0eh
int 10h
cmp si, -1
jg start
check:
mov al, msg[si]
mov ah, msg[di]
cmp al, ah
jmp notpalin
inc si
dec di
cmp si, 5
jl check
palin:
call pthis
db "This is a palindrome", 0
jmp stop
notpalin:
call pthis
db "This is not a palindrome", 0
jmp stop
stop:
mov ah, 0
int 16h ; wait for any key....
ret ; return to operating system.
DEFINE_PTHIS
哇哦,我很多接近然后我意识到。监督失误。感谢您的解决方案@Sep Roland,帮助我了解自己出错的地方。 – remedy