data segment
dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start: mov ax,stack
mov ss,ax
mov sp,16
mov ax,data
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
code ends
实验5.2
dw 0123h,0456h
data ends
stack segment
dw 0,0
stack ends
code segment
start: mov ax,stack
mov ss,ax
mov sp,16
mov ax,data
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
code ends
end start
实验5.3
code segment
start: mov ax,stack
mov ss,ax
mov sp,16
mov ax,data
mov ds,ax
push ds:[0]
push ds:[2]
pop ds:[2]
pop ds:[0]
mov ax,4c00h
int 21h
code ends
data segment
dw 0123h,0456h
data ends
stack segment
dw 0,0
stack ends
end start
~
实验5.5
a segment
db 1,2,3,4,5,6,7,8
a ends
b segment
db 1,2,3,4,5,6,7,8
b ends
c segment
db 0,0,0,0,0,0,0,0
c ends
code segment
start: mov bx,0
mov cx,8
s:mov ax,a
mov ds,ax
mov dl,[bx]
mov ax,b
mov ds,ax
add dl,[bx]
mov ax,c
mov ds,ax
mov [bx],dl
inc bx
loop s
code ends
end start
实验5.6
a segment
dw 1,2,3,4,5,6,7,8,9
a ends
b segment
dw 0,0,0,0,0,0,0,0,0
b ends
code segment
start: mov ax,a
mov ds,ax
mov bx,0
mov ax,b
mov ss,ax
mov sp,10h
mov cx,8
l:push [bx]
add bx,2
loop l
code ends
end start