COS2621 Assignment 2 2025
Ready to Submit. Instructions to run the code are also included; copy and paste
into CodeGrade
, Output
Question 1
(a) Memory Addressing Modes
LOAD IMMEDIATE 20: The immediate addressing mode takes the operand value (20)
directly from the instruction and places it into the accumulator. So 20 will be loaded.
LOAD DIRECT 20: Direct addressing uses the operand (20) as a memory address. The
processor retrieves the value stored at memory location 20, which contains 30. So 30 will
be loaded.
LOAD INDIRECT 20: Indirect addressing treats the operand (20) as a pointer to another
memory address. First, it reads the value at address 20 which is 30, then uses that value as
the actual memory address to access. So the content at address 30 is 40.
(b) Intel x86 Addressing Mode Examples
Addressing Mode Instruction
Immediate MOV EAX, 25
Direct MOV EAX, [2000h]
Ready to Submit. Instructions to run the code are also included; copy and paste
into CodeGrade
, Output
Question 1
(a) Memory Addressing Modes
LOAD IMMEDIATE 20: The immediate addressing mode takes the operand value (20)
directly from the instruction and places it into the accumulator. So 20 will be loaded.
LOAD DIRECT 20: Direct addressing uses the operand (20) as a memory address. The
processor retrieves the value stored at memory location 20, which contains 30. So 30 will
be loaded.
LOAD INDIRECT 20: Indirect addressing treats the operand (20) as a pointer to another
memory address. First, it reads the value at address 20 which is 30, then uses that value as
the actual memory address to access. So the content at address 30 is 40.
(b) Intel x86 Addressing Mode Examples
Addressing Mode Instruction
Immediate MOV EAX, 25
Direct MOV EAX, [2000h]