21,459
社区成员
发帖
与我相关
我的任务
分享
;
;This Program Compiled Sucess by Masm 6.15
;
assume cs:code,ds:data,ss:stack
data segment
buffer db 100,?,100 dup (0);定义输入缓冲区
data ends
stack segment stack
db 64 dup (0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
xor cx,cx
mov dx,offset buffer
mov ah,10
int 21h
;将缓冲区字符入栈
xor ax,ax
mov cl,buffer+1
mov bx,offset buffer+2
is:
mov al,[bx]
push ax
inc bx
loop is
;显示换行
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;出栈并显示
mov cl,buffer+1
mov ah,2
os:
pop dx
int 21h
loop os
mov ah,4ch
int 21h
code ends
end start