Prototyping an improvement to The Hex monitor's user interface for more primative hardware

This commit is contained in:
Jeremiah Orians 2016-08-24 19:44:54 -04:00
parent bd803a996b
commit fa0e0d063b
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
1 changed files with 12 additions and 7 deletions

View File

@ -17,15 +17,17 @@
LOADUI R1 0 ; Read from tty LOADUI R1 0 ; Read from tty
FGETC ; Read a Char FGETC ; Read a Char
;; Check for Ctrl-D CMPSKIP.NE R0 13 ; Replace all CR
CMPUI R14 R0 4 LOADUI R0 10 ; WIth LF
JUMP.NE R14 @.L0
CALLI R13 @finish FPUTC ; Display the Char to User
;; Check for Ctrl-D
CMPSKIP.NE R0 4
JUMP @finish
:.L0
;; Check for EOF ;; Check for EOF
JUMP.P R0 @.L1 JUMP.NP R0 @finish
CALLI R13 @finish
:.L1 :.L1
LOADUI R1 0x1101 ; Write to TAPE_02 LOADUI R1 0x1101 ; Write to TAPE_02
@ -91,6 +93,9 @@
:ascii_comment :ascii_comment
LOADUI R1 0 ; Read from tty LOADUI R1 0 ; Read from tty
FGETC ; Read another char FGETC ; Read another char
CMPSKIP.NE R0 13 ; Replace all CR
LOADUI R0 10 ; WIth LF
FPUTC ; Let the user see it
CMPUI R14 R0 10 ; Stop at the end of line CMPUI R14 R0 10 ; Stop at the end of line
LOADUI R1 0x1101 ; Write to TAPE_02 LOADUI R1 0x1101 ; Write to TAPE_02
FPUTC ; The char we just read FPUTC ; The char we just read