(1)
assume cs:code,ds:data,ss:stack
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
end start
1.資料不變
2.ss 076b ds 076a cs 076c
3.x-2 x-1
(2)assume cs:code,ds:data,ss:stack
data segment
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
1.資料不變
2.ss 076b ds 076a cs 076c
3.x-2 x-1
4.(n+15)/16*16
(3)1.不變
2.cs = 076a ss = 076e ds = 076d
3.x+3 x+4
(4)
不指明程式入口,第(3)個程式仍然可以正確執行。
(5)編寫code段中的**,將a段和b段中的資料依次相加,將結果儲存到c段中。
assume cs:code
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 ax,a
mov ds,ax
mov si,0
mov di,20h
mov cx,8
s: mov al,ds:[si]
add al,ds:[si + 10h]
mov ds:[di],al
inc si
inc di
loop s
mov ax,4c00h
int 21h
code ends
end start
(6)編寫code段中的**,用push指令將a段中的前8個字型資料,逆序儲存到b段中。
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
start:
mov ax,b
mov ss,ax
mov sp,10h
mov ax,a
mov ds,ax
mov di,0
mov cx,8
s: push ds:[di]
add di,2
loop s
mov ax,4c00h
int 21h
code ends
end start
push指令
sp = sp -2
王爽彙編第二版實驗4
1 程式設計,向記憶體0 200 0 23f依次傳送資料0 63.assume cs code code segment start mov ax,0020h mov ds,ax mov bx,0 mov cx,40h s mov bx bx inc bx 每次移動一位,覆蓋高位,保留低位 loop...
王爽彙編第二版第7章實驗6
程式設計,將datasg段中每個單詞的前4個字母改為大寫字母 assume cs codesg,ss stacksg,ds datasg stacksg segment dw 0,0,0,0,0,0,0,0 stacksg ends datasg segment db 1.display db 2....
王爽彙編第二版第9章
無條件跳轉指令jmp jmp short 標號 8位位移 jmp near ptr 標號 16位位移 jmp far ptr 標號 檢測點9.1 1 assume cs code data segment dw 0,offset start data ends code segment start ...