An assignment asks to load the location of a trap we were asked to write into location x0026 of the trap vector table. I understand loading into a register, but I'm not sure as far as loading something into the trap vector table. Any help is appreciated!
Asked
Active
Viewed 899 times
1 Answers
1
All you need to do is load your trap call as a separate .obj file into the simulator before you load your program.
This creates a new trap call for x26
.orig x26
.fill x5000
.end
This means when you use TRAP x26 in your program it will run whatever code you have saved at x5000

Chris M
- 651
- 6
- 10
-
Is there any way to do this within the same .obj file? – Emily Nunn May 04 '15 at 06:53
-
I've been trying to find a good way to do that but I don't think the standard LC3 editor supports the pseudo-opcode ".EXTERNAL" I've tried without luck. But you can just combine all of your code into one file, unless it's for a trap vector table entry. – Chris M May 04 '15 at 07:49