Download presentation
Presentation is loading. Please wait.
Published byJane Griffin Modified over 9 years ago
1
第 4 章习题参考答案: 2 、取 SIZE 属性 A1——2 字节( 4 ) A2——3 字节( 6 ) A3——20 字节( 40 ) A4——4 字节( 60 ) 4 、 L=6 5 、 PLENTH=22, 可用于确定循环次数。 7 、( AX ) =1 ( BX ) =20 ( CX ) =1
2
mov ax,[bx] mov max,ax mov min,ax chk: add bx,2 mov ax,[bx] cmp ax,max jle next1 mov max,ax next1:cmp ax,min jge next2 mov min,ax next2:loop chk mov ah,4ch int 21h code ends end start ;P168 exercise 4_6 Datasegment dat db 5 list dw -1,0,8,12,5,5 dup (?) max dw ? min dw ? data ends stack segment stack dw 100 dup(?) Stack ends code segment assume cs:code,ds:data,ss:stack start:mov ax,data mov ds,ax mov bx,offset list mov cx,4
3
第 5 章习题参考答案: again:mov ax,es:[si] and ax,ax jz next mov es:[di],ax add di,2 next: add si,2 loop again sub si,di mov cx,si mov al,0 rep stosb ;(es:di)<---(al) mov ah,4ch int 21h code ends end start ;P214 exercise 5_8 data segment buff dw 10,10 dup(?) data ends stack segment stack dw 100 dup(?) stack ends code segment assume cs:code,es:data,ss:stack start:mov ax,data mov es,ax lea si,buff mov cx,es:[si] add si,2 mov di,si
4
mov cx,n mov dx,0 again:mov al,[bx] test al,80h jz posi inc dl mov [di],al inc di jmp next posi: inc dh mov [si],al inc si next: inc bx loop again mov ah,4ch int 21h code ends end start ;P214 exercise 5_12 data segment array db 1,2,3,4,-1,-2,-3,-4 n equ $-array positive db 10h dup(?) negative db 10h dup(?) data ends stack segment stack dw 100 dup(?) stack ends code segment assume cs:code,ds:data,ss:stack start:mov ax,data mov ds,ax mov bx,offset array mov si,offset positive mov di,offset negative
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.