TRAP · LC 您所在的位置:网站首页 lc3指令 TRAP · LC

TRAP · LC

2024-06-22 13:19| 来源: 网络整理| 查看: 265

Trap Instruction

Trap can be used for various system calls and service routines.

This means Trap can handle Input/Output (I/O).

Trap transfers over control to the operating system then returns control back to the user.

1111 0000 vvvv vvvv

vvvv vvvv: Trap Vector is one of several options:

x20 (hex); 0010 0000 (binary) - 1111 0000 0010 0000 GETC: Reads a single character in Writes single ASCII char to R0 x21 (hex); 0010 0001 (binary) - 1111 0000 0010 0001 OUT: Outputs a single char from R0 to the console x22 (hex); 0010 0010 (binary) - 1111 0000 0010 0010 PUTS: Prints a string to the console(prints contiguous chars from an address of value of R0 until a terminating character is encountered) x23 (hex); 0010 0011 (binary) - 1111 0000 0010 0011 IN: Print prompt to console, read and echo character from keyboard x25 (hex); 0010 0101 (binary) - 1111 0000 0010 0101 HALT: Halt(Stop) the Program


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有