This homework is based on Homework 5 for ECE 109.
This assignment is due in class Thursday, 2 April or to my office assistant in RH 215 by 4:30 pm on 2 April.
In this question encode the proper instructions in hexadecimal to achieve the task asked in the question. Each question can be done with only one intsruction
Encode in hex an instruction to load the contents of Memory at address
x30FD
into R3
.
The encoded instruction will be stored at memory location
x3000
.
The following tables contain known memory and register contents.
|
|
Encode in hex an instruction that would load the contents of memory
in location x4000
into R4
.
The encoded instruction will be stored at memory location
x3001
.
Encoded in hex an instruction that would store the value in R0
into
memory location x5F00
.
The encoded instruction will be stored at memory location
x3002
.
This question tests your ability to understand the different types of addressing modes used in LC-3 load/store instructions.
In the program below assume all register are intially zero.
The program begins running at memory location x3000
.
Assume the program runs until it encounters
the HALT
(TRAP x25
) instruction.
If an instruction stores a result into a register value,
write down the result, the destination register, and the modified
NZP
bits for that instruction.
Fill in the contents of the registers just before
Address | Memory contents |
Result | Register | NZP |
---|---|---|---|---|
for destination register when appropriate | ||||
x3000 | 0010010000000100 | |||
x3001 | 1110001000000010 | |||
x3002 | 0110000001000000 | |||
x3003 | 0000111000000010 | |||
x3004 | 0011000000001000 | |||
x3005 | 0000000000100111 | |||
x3006 | 1010011111111101 | |||
x3007 | 0000111000000001 | |||
x3008 | 0000000000001011 | |||
x3009 | 1001010010111111 | |||
x300A | 0001010010000001 | |||
x300B | 0001000010000000 | |||
x300C | 1111000000100101 |
What are the values of register R0
,
R10
,
R2
, and
R3
when the HALT
is reached?