You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the LC3 spec, the TRAP instruction should save the incremented PC to R7 and then jump to the trap implementation using the trap vector table.
Since we're implementing traps directly in the VM instead of relying on a assembly-based implementations, we don't need to jump to the implementation. However, the fact that R7 changes is technically part of the spec and is an observable side-effect, so we should still make that change. Without it, it's easy to write programs that work on our VM but not the official VM due to forgetting to save R7.
The text was updated successfully, but these errors were encountered:
According to the LC3 spec, the TRAP instruction should save the incremented PC to R7 and then jump to the trap implementation using the trap vector table.
Since we're implementing traps directly in the VM instead of relying on a assembly-based implementations, we don't need to jump to the implementation. However, the fact that R7 changes is technically part of the spec and is an observable side-effect, so we should still make that change. Without it, it's easy to write programs that work on our VM but not the official VM due to forgetting to save R7.
The text was updated successfully, but these errors were encountered: