以下程序MASM5测试通过
;将输入的字符串反向输出
;作者:永夜的极光
;时间:2007-11-28
;程序运行结果:
;Please Input String(Len<50):abcdefg
;After change:gfedcba
;Press Any Key To Exit...
.model small
.386
.data
inf0 db 'Please Input String(Len<50):','$'
inf1 db 13,10,'After change:','$'
buf db 50,?,50 dup (?)
inf_exit db 13,10,'Press Any Key To Exit...$'
.code
mov ax,@data
mov ds,ax
lea dx,inf0
mov ax,0900H
int 21H
lea dx,buf
mov ax,0a00H
int 21H
lea dx,inf1
mov ax,0900H
int 21H
xor cx,cx
mov cl,buf[1]
lea si,buf[1]
add si,cx
mov ax,0200H
l1:
mov dl,[si]
int 21H
dec si
loop l1
lea dx,inf_exit
mov ax,0900H
int 21H
mov ax,0700H
int 21H
mov ah,4ch
int 21h
end
[[italic] 本帖最后由 永夜的极光 于 2007-11-28 12:57 编辑 [/italic]]