第二章 检测点2.1
(1)写出每条汇编指令执行后相关寄存器中的值。
mov ax, 62627 //ax = F4A3H
mov ah, 31H //ax = 31A3H
mov al, 23H //ax = 3123H
add ax, ax //ax = 6246H
mov bx, 826CH //ax = 6246H, bx = 826CH
mov cx, ax //ax = 6246H, bx = 826CH, cx = 6246H
mov ax, bx //ax = 826CH, bx = 826CH, cx = 6246H
add ax, bx //ax = 04D8H, bx = 826CH, cx = 6246H
//826CH + 826CH = 104D8H(高位溢出)
mov al, bh //ax = 0482H, bx = 826CH, cx = 6246H
mov ah, bl //ax = 6C82H, bx = 826CH, cx = 6246H
add ah, ah //ax = D882H, bx = 826CH, cx = 6246H
//6CH + 6CH = D8H
add al, 6 //ax = D888H, bx = 826CH, cx = 6246H
//82H + 6 = 88H
add al, al //ax = D810H, bx = 826CH, cx = 6246H
//88H + 88H = 110H(高位溢出)
mov ax, cx //ax = 6246H, bx = 826CH, cx = 6246H
mov ah, 31H //ax = 31A3H
mov al, 23H //ax = 3123H
add ax, ax //ax = 6246H
mov bx, 826CH //ax = 6246H, bx = 826CH
mov cx, ax //ax = 6246H, bx = 826CH, cx = 6246H
mov ax, bx //ax = 826CH, bx = 826CH, cx = 6246H
add ax, bx //ax = 04D8H, bx = 826CH, cx = 6246H
//826CH + 826CH = 104D8H(高位溢出)
mov al, bh //ax = 0482H, bx = 826CH, cx = 6246H
mov ah, bl //ax = 6C82H, bx = 826CH, cx = 6246H
add ah, ah //ax = D882H, bx = 826CH, cx = 6246H
//6CH + 6CH = D8H
add al, 6 //ax = D888H, bx = 826CH, cx = 6246H
//82H + 6 = 88H
add al, al //ax = D810H, bx = 826CH, cx = 6246H
//88H + 88H = 110H(高位溢出)
mov ax, cx //ax = 6246H, bx = 826CH, cx = 6246H
(2)只能使用目前学过的汇编指令,最多使用4条指令,编程计算2的4次方。
mov ax, 2H //ax = 2H
add ax, ax //ax = 2H + 2H = 4H
add ax, ax //ax = 4H + 4H = 8H
add ax, ax //ax = 8H + 8H = 10H
add ax, ax //ax = 2H + 2H = 4H
add ax, ax //ax = 4H + 4H = 8H
add ax, ax //ax = 8H + 8H = 10H