1 / 18

Chapter 9 TRAP Routines and Subroutines

Chapter 9 TRAP Routines and Subroutines. System Calls. System Call. LC-3 TRAP Mechanism. TRAP Instruction. TRAP. RET (JMP R7). TRAP Mechanism Operation. TRAP Routines and their Assembler Names. Example: Using the TRAP Instruction. Example: Output Service Routine. TRAP_PUTS

darren
Télécharger la présentation

Chapter 9 TRAP Routines and Subroutines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 9TRAP Routines andSubroutines

  2. System Calls

  3. System Call

  4. LC-3 TRAP Mechanism

  5. TRAP Instruction

  6. TRAP

  7. RET (JMP R7)

  8. TRAP Mechanism Operation

  9. TRAP Routines and their Assembler Names

  10. Example: Using the TRAP Instruction

  11. Example: Output Service Routine TRAP_PUTS ST R0,OS_SAVE_R0 ; save R0, R1, and R7 ST R1,OS_SAVE_R1 ST R7,OS_SAVE_R7 ADD R1,R0,#0 ; move string pointer (R0) into R1 TRAP_PUTS_LOOP LDR R0,R1,#0 ; write characters in string using OUT BRz TRAP_PUTS_DONE OUT ADD R1,R1,#1 BRnzp TRAP_PUTS_LOOP TRAP_PUTS_DONE LD R0,OS_SAVE_R0 ; restore R0, R1, and R7 LD R1,OS_SAVE_R1 LD R7,OS_SAVE_R7 RET stored in table,location x22

More Related