CS 2110 Lecture 9: LC-3 Instruction sets
Document Summary
Biggest 2"s complement # we can represent with 6 bits: 31. Treating a general purpose register as a memory address. Taking from the base register, treat it as a memory address, add the offset to it, and then put the value in the dr. If memory was a giant array, the index of the array that you"d shove into the dr is memory[baser + offset] If you don"t want an offset you can just shove 0 in it. Calculate the effective address the same way, but instead of reading from external mem, you"re writing to it. Ldr and str are inverses of each other. Take the sr and store it somewhere, so you use the address of the baser + offset. Oh my god i understand so much more ;w; thank god. Dr = (pc + 1) + offset. Lea: rd pc + 1 + pcoffset9. Puts the address represented by some label into register.