assume cs:code
a segment
dw 1,2,3,4,5,6,7,8,9,0ah,0bh,0ch,0dh,0eh,0fh,0ffh
a ends
b segment
dw 0,0,0,0,0,0,0,0
b ends
code segment
main:
mov ax,a
mov ds,ax ;data
mov ax,b
mov ss,ax ;stack
mov sp,16 ;这里是16而不是8,切忌
mov bx,0
mov cx,8 ;8次循环入栈
x: push [bx]
add bx,2
loop x
mov ax,4c00h
int 21h
code ends
end main |