CS计算机代考程序代写 assembly Soalan 8/Question 8 (10 markah/marks)

Soalan 8/Question 8 (10 markah/marks)

Berikut adalah sebahagian daripada arahan dalam satu atur cara bahasa himpunan.
The following is a part of instructions in an assembly language program.
.
MOV AX, 0 ;0
MOVSX BX, F2H ; 1111 1111 1111 0010 = FFF2;
MOVZX CX, 02H ; 0002h = 2
MOV DX, 2 ; 0010 = 2

A20: INC AX ;= 1 = 2
INC CX ;= 2 + 1 = 3 = 4
ADD AX, CX ;= 4 = 6
SHL DX, 3 ;= 0010 = 10000 = 16 = 10000000 = 128
CMP DX, 16 ; If DX = 16 then ZF = 1 zf=0
JE A20 ; Jump Not Equal
; Change to JE A20 ; Jump Equal

MOV AX, 4C00H
INT 21H

• Apakah nilai dalam pendaftar AX, BX, CX, dan DX selepas semua arahan di atas dilaksanakan?
(What are the values in the AX, BX, CX, and DX registers after all the above instructions are executed?)
[4 M/CPS4]
Jawapan (Answer):

AX = _4C0016_ BX = __FFF216__

CX = ___3___ DX = ____16____

• Jika arahan JNE A20 digantikan dengan arahan JE A20, apakah nilai dalam pendaftar AX, BX, CX, dan DX selepas semua arahan di atas dilaksanakan?
If JNE A20 instruction is replaced with the JE A20 instruction, what are the values in the AX, BX, CX, and DX registers after all the above instructions are executed?
[4 M/CPS4]
Jawapan (Answer):
AX = _4C0016_ BX = __ FFF216__

CX = ___4____ DX = ___128____

• Jika arahan JNE A20 digantikan dengan arahan LOOP A20, berapa kalikah arahan LOOP A20 ini akan dilaksanakan?
(If JNE A20 instruction is replaced with the LOOP A20 instruction, how many times does the LOOP A20 instruction will be executed?)
[2 M/CPS4]
Jawapan (Answer) : _______