Documentation ¶
Index ¶
Constants ¶
View Source
const ( R_R0 uint16 = iota R_R1 R_R2 R_R3 R_R4 R_R5 R_R6 R_R7 R_PC // program counter R_COND R_COUNT )
Registers
View Source
const ( OP_BR uint16 = iota // branch OP_ADD // add OP_LD // load OP_ST // store OP_JSR // jump register OP_AND // bitwise and OP_LDR // load register OP_STR // store register OP_RTI // unused OP_NOT // bitwise not OP_LDI // load indirect OP_STI // store indirect OP_JMP // jump OP_RES // reserved (unused) OP_LEA // load effective address OP_TRAP // execute trap )
Opcodes
View Source
const ( FL_POS uint16 = 1 << 0 // Positive FL_ZRO uint16 = 1 << 1 // Zero FL_NEG uint16 = 1 << 2 // Negative )
Condition Flags
View Source
const ( TRAP_GETC = 0x20 // get character from keyboard, not echoed onto the terminal TRAP_OUT = 0x21 // output a character TRAP_PUTS = 0x22 // output a word string TRAP_IN = 0x23 // get character from keyboard, echoed onto the terminal TRAP_PUTSP = 0x24 // output a byte string TRAP_HALT = 0x25 // halt the program )
View Source
const ( MR_KBSR uint16 = 0xfe00 // keyboard status MR_KBDR uint16 = 0xfe02 // keyboard data )
View Source
const MaxMemorySize uint16 = 65535
MaxMemorySize maximum RAM size.
View Source
const PC_START uint16 = 0x3000
Variables ¶
This section is empty.
Functions ¶
func GetCharFromStdin ¶
func GetCharFromStdin() uint16
GetCharFromStdin get one char from standard input.
Types ¶
Click to show internal directories.
Click to hide internal directories.