0
$\begingroup$

I am working on a question from a practice computer organization exam. The answer key to one of the questions says that both LD and LEA instructions of the LC-3 processor can access memory at an arbitrary distance (say #1000) from the instruction.

How is this correct?

I think that LD uses PC relative mode, meaning it has 9 bits for offset or can access a memory location 256 spots away from the address in the program counter register(address of next instruction). That's not far enough for the criterion in the question. The argument for LEA is the same.

Can anyone explain why I get a different answer to the key?

$\endgroup$
8
  • $\begingroup$ I've edited the question to make it more of a conceptual question about what the instructions actually do, rather than a "help me with this exam question"-type question. Please check that I didn't mess anything up or misrepresent what you wrote and feel free to edit my edit. $\endgroup$ Apr 21 '15 at 20:04
  • $\begingroup$ I'm a theoretician so I'm not going to try to answer your question. However, the behaviour of any particular instruction is defined by the processor that executes it. Could it just be that you chose a different processor from the one the question's authors had in mind? $\endgroup$ Apr 21 '15 at 20:06
  • $\begingroup$ Cant be because I am using the same one from class, the ISA of the LC-3 $\endgroup$ Apr 21 '15 at 20:15
  • 1
    $\begingroup$ @D.W. The comments explain what processor was being used so I've edited that into the question. Also, after my edits, I think this is a conceptual question about how that processor handles memory addresses. The exam question provides context but the question is about the processor, not the exam. $\endgroup$ Apr 22 '15 at 8:03
  • $\begingroup$ It is very clear that the LEA instruction does not directly access memory, and that clearly contradicts your interpretation of the answer key (and/or of the question). That tells me that your difficulty is in how the question was formulated, not with its content. For all we know, the exam question can actually be misleading, so I don't think your question is answerable as it is. $\endgroup$ Apr 23 '15 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.