How to load a location into the trap vector table LC3

937 Views Asked by At

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!

1

There are 1 best solutions below

2
Chris M On

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