From fa0e0d063bd2134ad5d7326ad6ffa9fc23007c8e Mon Sep 17 00:00:00 2001 From: Jeremiah Orians Date: Wed, 24 Aug 2016 19:44:54 -0400 Subject: [PATCH] Prototyping an improvement to The Hex monitor's user interface for more primative hardware --- stage0/stage0_monitor.s | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/stage0/stage0_monitor.s b/stage0/stage0_monitor.s index 8aad139..cf11d35 100644 --- a/stage0/stage0_monitor.s +++ b/stage0/stage0_monitor.s @@ -17,15 +17,17 @@ LOADUI R1 0 ; Read from tty FGETC ; Read a Char - ;; Check for Ctrl-D - CMPUI R14 R0 4 - JUMP.NE R14 @.L0 - CALLI R13 @finish + CMPSKIP.NE R0 13 ; Replace all CR + LOADUI R0 10 ; WIth LF + + FPUTC ; Display the Char to User + + ;; Check for Ctrl-D + CMPSKIP.NE R0 4 + JUMP @finish -:.L0 ;; Check for EOF - JUMP.P R0 @.L1 - CALLI R13 @finish + JUMP.NP R0 @finish :.L1 LOADUI R1 0x1101 ; Write to TAPE_02 @@ -91,6 +93,9 @@ :ascii_comment LOADUI R1 0 ; Read from tty 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 LOADUI R1 0x1101 ; Write to TAPE_02 FPUTC ; The char we just read