putchar # Description: # Writes one character to the terminal. # Stack Requirements: # Character to write # Return PC <-- TOS WORD_134217728 # XBUF WORD_134217732 # XCSR LDSP+3 SWAP putcharloop LDSP+0 LOAD TEST BRZ>putcharloop TEST # Drop XCSR from stack SWAP STORE # Wrote the character. Clean up stack and return. STSP+0 RTS getchar # Description: # Reads one character from the terminal. # Stack Requirements: # Return PC <-- TOS WORD_134217736 # RBUF WORD_134217740 # RCSR getcharloop LDSP+0 LOAD TEST BRZ>getcharloop LDSP+1 LOAD # Found a character. Clean up stack and return. STSP+0 STSP+0 SWAP RTS