asm--输入字符串,回车结束,逆序输出

s1 segment stack
dw 400 dup(?)
tos label word
s1 ends

s2 segment
assume cs:s2,ss:s1
main proc near
mov ax,s1
mov ss,ax
lea sp,tos
mov cx,0

ko:
mov ah,01h
int 21h
cmp al,0dh
je output1
push ax
inc cx
jmp ko

output1:
mov dl,0dh
mov ah,02h
int 21h
mov dl,0ah
mov ah,02h
int 21h

output2:
pop dx
mov ah,02h
int 21h
loop output2

mov ah,4ch
int 21h
main endp
s2 ends
end main

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值