assume cs:codeseg
codeseg segment
dw 1h, 2h, 3h, 4h, 5h, 6h, 7h, 8h, 9h
dw 9 dup(?)
start:
; 设置栈段
mov ax, cs
mov ss, ax
; 36 = 9 * 2 * 2
mov sp, 36
sub bx, bx
mov cx, 9
s_push:
mov ax, cs:[bx]
push ax
add bx, 2
loop s_push
sub bx, bx
mov cx, 9
s_pop:
pop cs:[bx]
add bx, 2
loop s_pop
mov ah, 4ch
int 21h
codeseg ends
end start