汇编语言 参考答案

第一章
检测点1.1
1) 13
  (8kb = 8 * 1024 = 2^13)  

2) 1024 0 1023

3) 8*1024 1024
  (1 byte = 8 bit,计算机以byte为存储单位)

4) 1024^3 1024^2 1024

5) 2^6 1 2^4 2^2
  (kb = 2^10 Mb = 2^20 Gb = 2^30)

6) 1 1 2 2 4

7) 512 256
  (8086的寄存器为16位寄存器,一次可以读取两个字节,80386为32位寄存器)

8) 二进制
复制代码
复制代码
第二章
检测点2.1
1)
AX = F4A3h
AX = 31A3h
AX = 3123h
AX = 6246h
BX = 826Ch
CX = 6246h
AX = 826Ch
AX = 04D8h
AX = 0482h
AX = 6C82h
AX = D882h
AX = D888h
AX = D810h
AX = 6246h

2)
mov ax,2
add ax,ax
add ax,ax
add ax,ax

检测点2.2
1)00010h 1000fh
    (0001h+0000h 0001h+ffffh)

2)1001h 2000h
    (偏移地址的范围为0000-ffff,内存单元=段地址*16+偏移地址,当偏移地址最小时,段地址最大,偏移地址最大时,段地址最小)

检测点2.3
4次修改IP,最后IP为0
复制代码
复制代码
第三章
检测点3.1
1)
mov ax,1
mov ds,ax
mov ax,[1000] AX = 2662h
mov bx,[1001] BX = E626h
mov ax,bx       AX = E626h
mov ax,[0000] AX = 2662h
mov bx,[0002] BX = D6E6h
add ax,bx        AX = FD48h
add ax,[0004]  AX = 2C14h
mov ax,0         AX = 0000h
mov al,[0002]  AX = 00E6h 
mov bx,0         BX = 0000h
mov bl,[000C]  BX = 0026h
add al,bl          AX = 000Ch

2)
CS = 2000h,IP = 0,DS = 1000h
mov ax,6622h  AX = 6622h
jmp 0ff0:0100h CS = 0ff0 IP = 0100h
mov ax,2000h  AX = 2000h
mov ds,ax       DS = 2000h
mov ax,[0008] AX = C389h
mov ax,[0002] AX = EA66h
mov ax,6622h  AX = 6622h
数据和程序表达上没有区别,只跟存储的地方有关,存在数据段中即为数据,存在程序段中就是程序

检测点3.2
1)
mov ax,2000h
mov ss,ax
mov sp,10h

2)
mov ax,1000h
mov ss,ax
mov sp,0
复制代码
复制代码
第六章
检测点6.1
1)
mov cs:[bx],ax

2)
cs
26或1ah
pop cs:[bx]
复制代码
复制代码
第九章
检测点9.1
1)
db 8 dup (0)

2)
offset start
cs
3)
CS = 0006h IP = 00BE

检测点9.2
mov cl,[bx]
mov ch,0
jcxz ok
inc bx

检测点9.3
inc cx
  (因为loop s执行时是先将cx减一再与0比较)
复制代码
复制代码
第十章
检测点10.1
1000
0000

检测点10.2
ax = 3

检测点10.3
ax = 1006

检测点10.4
ax = 9
(call ax时将IPpush到栈中,也就是push 3)

检测点10.5
1)
ax = 3
2)
ax = 0001 bx = 0000
复制代码
复制代码
第十一章
检测点11.1
1 1 0
1 1 0 
1 1 0
1 1 0
0 0 0
0 1 0
0 1 0
检测点11.2
0 0 0 1 1
0 0 0 1 1
0 0 1 0 0
0 0 1 0 0
1 1 0 1 1
1 1 0 1 1
1 0 0 0 0
1 0 0 0 0
0 1 1 0 1
检测点11.3
1)
jna s0
jna s0
2)
jb s0
jb s0
检测点11.4
ax = 0871h
复制代码
复制代码
检测点12.1
1)
039D:0016

2)
0000:[4N]
0000:[4N+2]
复制代码
复制代码
检测点13.1
assume cs:code,ds:data
    data segment
        db 'conversation',0
    data ends

    code segment
start:    mov ax,cs
    mov ds,ax
    mov si,offset show
    mov ax,0
    mov es,ax
    mov di,200h
    mov cx,offset showend-offset show
    cld
    rep movsb

    mov ax,0
    mov es,ax
    mov word ptr es:[7ch*4],200h
    mov word ptr es:[7ch*4+2],0
    
    mov ax,data
    mov ds,ax
    mov si,0
    mov ax,0b800h
    mov es,ax
    mov di,12*160
    
s:    cmp byte ptr [si],0
    je ok
    mov al,[si]
    mov es:[di],al
    mov al,2
    mov es:[di+1],al
    inc si
    add di,2
    mov bx,offset s-offset ok
    int 7ch
    
ok:    mov ax,4c00h
    int 21h
show:    push bp
    mov bp,sp
    add [bp+2],bx
    pop bp
    iret
showend:nop
    code ends
    end start
检测点13.2
1)
错误,不能向BIOS中写程序
2)
错误,19h中断在操作系统以前,而DOS由操作系统控制即在操作系统以后
复制代码
复制代码
检测点14.1
1)
mov al,2
out 70h,al
in al,71h
2)
mov al,0
out 71h,al
mov al,2
in 70h,al
检测点14.2
在不考虑溢出的情况下:
mov ax,__
mov bx,ax
shl bx,1
mov cl,3
shl ax,cl
add ax,bx
复制代码
复制代码
第十五章
检测点15.1
1)
pushf
call dword ptr ds:[0]

2)
在中断向量表中设置新的int9中断入口地址的时候不让其发生中断,即
cli
mov word ptr es:[9*4],offset int9
mov word ptr es:[9*4+2],cs
sti
恢复中断向量表int9的源地址时同理:
cli
push ds:[0]
pop es:[9*4]
push ds:[2]
pop es:[9*4+2]
sti
复制代码
复制代码
第十六章
检测点16.1
a[si]
b
b
1
检测点16.2
mov ax,data
mov es,ax
复制代码
第十七章
检测点17.1
IF = 1 DI(disable interupt)
IF = 0 EI(enable interupt)
当执行int16中断时是从缓冲区中读出字符,若缓冲区为空,则int16应该可以响应int9的中断,故IF不一定为1
原文地址:https://www.cnblogs.com/laoyangtou/p/8745852.html