Jump to content

LC-3 Instructions & Registers, HELP!


moonlit

Recommended Posts

I'm having a difficult time understanding LC-3 instructions and registers. Can someone help me with these few problems, maybe explain them step by step. Thanks!

 

1) What is the difference between the following LC-3 instructions A and B? How are they similar and how are they different?

A: 0000111101010101

B: 0100111101010101

 

2) The LC-3 does not have an opcode for the logical function OR. That is, there is no instruction in the LC-3 ISA that performs the OR operation. However, we can write a sequence of instructions to implement the OR operation. THe four instruction sequence below performs the OR of the contents of register 1 and register 2 and puts the results in register 3. Fill in the two missing instructions so that the four instruction sequence will do the job:

(1): 1001 100 001 111111

(2):

(3): 0101 110 100 000 101

(4):

 

3) The PC contains x3010. The following memory locations contain values as shown:

x3050 x70A4

x70A2 x70A3

x70A3 xFFFF

x70A4 x123B

The following three LC-3 instructions are then executed, causing a value to be loaded into R6. What is the value?

x3010: 1110 1110 0011 0001

x3011: 0110 1000 1100 0000

x3012: 0110 1101 0000 0000

We could replace the three-instruction sequence with a single instruction. What is it?

 

4) It is the case that we REALLY do not need to have load indirect (1010) and store indirect (1011) instructions. We can accomplish the same results using other instruction sequences instead of using these instructions. Replace the store indirect (1011) instruction in the code below with whatever instructions are necessary to perform the same function:

x3000: 0010 0000 0000 0010

x3001: 1011 0000 0000 0010

x3002: 1111 0000 0010 0101

x3003: 0000 0000 0100 1000

x3004: 1111 0011 1111 1111

Link to comment
Share on other sites

perhaps if you gave us the instructions in a different format, seeing the opcodes mean nothing to me as I have never used LC-3, so I would need an entire list of opcodes & corresponding instructions to see what you are trying to do.

 

ex) ADD R1,R1,R3

ADD R1,R1,#3

LD R6,NUMBER

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...
Guest asdasdasdasd

Hey moon lit do u still have the answers to those questions. I would like to know them. just e-mail me

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.