From 05dd6efbe941e900de9e992158e9b20cf8b271f9 Mon Sep 17 00:00:00 2001 From: Jeremiah Orians Date: Sat, 3 Sep 2016 23:18:19 -0400 Subject: [PATCH] Converted more prototype to hex0 --- stage1/more.hex0 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 stage1/more.hex0 diff --git a/stage1/more.hex0 b/stage1/more.hex0 new file mode 100644 index 0000000..7097039 --- /dev/null +++ b/stage1/more.hex0 @@ -0,0 +1,30 @@ +# :start +2D22000a # LOADUI R2 10 ; We will be using R2 for our counter +# ;; Prep TAPE_01 +2D201100 # LOADUI R0 0x1100 +42100000 # FOPEN_READ +# :main +# ;; Read a byte +2D211100 # LOADUI R1 0x1100 +42100100 # FGETC +# ;; Check for EOF +A0100000 # CMPSKIP.GE R0 0 +3C000028 # JUMP @main_1 +# ;; Write the Byte +0D000021 # FALSE R1 +42100200 # FPUTC +# ;; Check for LF +A030000a # CMPSKIP.NE R0 10 ; Skip if not line feed +10220001 # SUBI R2 R2 1 ; Decrement on line feed +# ;; Loop if not Zero +A0220000 # CMPSKIP.E R2 0 ; Skip if counter is zero +3C00ffdc # JUMP @main +# ;; Otherwise provide main loop functionality +42100100 # FGETC ; Wait for key press +2D22000a # LOADUI R2 10 ; Reset counter +3C00ffd0 # JUMP @main ; And loop +# :main_1 +# ;; Close up as we are done +2D201100 # LOADUI R0 0x1100 ; Close TAPE_01 +42100002 # FCLOSE +FFFFFFFF # HALT