Improved Stage0 and reduced size of required binary

This commit is contained in:
Jeremiah Orians 2016-06-25 23:17:35 -04:00
parent 9df3924351
commit 806ffaaa77
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
2 changed files with 9 additions and 13 deletions

View File

@ -20,26 +20,24 @@
# ;; Check for Ctrl-D # ;; Check for Ctrl-D
1FE00004 # CMPUI R14 R0 4 1FE00004 # CMPUI R14 R0 4
2C6E0008 # JUMP.NE R14 @.L0 2C6E0008 # JUMP.NE R14 @.L0
2D0D00d0 # CALLI R13 @finish 2D0D00c8 # CALLI R13 @finish
# .L0 # .L0
# ;; Check for EOF # ;; Check for EOF
12E0ffff # CMPI R14 R0 -1 2CB00008 # JUMP.P R0 @.L1
2C6E0008 # JUMP.NE R14 @.L1 2D0D00c0 # CALLI R13 @finish
2D0D00c4 # CALLI R13 @finish
# .L1 # .L1
2D211101 # LOADUI R1 0x1101 ; Write to TAPE_02 2D211101 # LOADUI R1 0x1101 ; Write to TAPE_02
42100200 # FPUTC ; Print the Char 42100200 # FPUTC ; Print the Char
2D0D0038 # CALLI R13 @hex ; Convert it 2D0D0034 # CALLI R13 @hex ; Convert it
12E00000 # CMPI R14 R0 0 ; Check if it is hex 2CC0ffd8 # JUMP.NP R0 @loop ; Don't use nonhex chars
2C8Effd0 # JUMP.L R14 @loop ; Don't use nonhex chars
2C9B0010 # JUMP.Z R11 @.L99 ; Jump if toggled 2C9B0010 # JUMP.Z R11 @.L99 ; Jump if toggled
# ;; Process first byte of pair # ;; Process first byte of pair
05020F0A # AND R15 R0 R10 ; Store First nibble 05020F0A # AND R15 R0 R10 ; Store First nibble
0D00002B # FALSE R11 ; Flip the toggle 0D00002B # FALSE R11 ; Flip the toggle
3C00ffc0 # JUMP @loop 3C00ffc8 # JUMP @loop
# .L99 # .L99
2D5F0004 # SL0I R15 4 ; Shift our first nibble 2D5F0004 # SL0I R15 4 ; Shift our first nibble
@ -48,7 +46,7 @@
2D1B0001 # LOADI R11 1 ; Flip the toggle 2D1B0001 # LOADI R11 1 ; Flip the toggle
2D211100 # LOADUI R1 0x1100 ; Write the combined byte 2D211100 # LOADUI R1 0x1100 ; Write the combined byte
42100200 # FPUTC ; To TAPE_01 42100200 # FPUTC ; To TAPE_01
3C00ffa4 # JUMP @loop ; Try to get more bytes 3C00ffac # JUMP @loop ; Try to get more bytes
# hex # hex
# ;; Deal with line comments starting with # # ;; Deal with line comments starting with #

View File

@ -24,16 +24,14 @@ loop
.L0 .L0
;; Check for EOF ;; Check for EOF
CMPI R14 R0 -1 JUMP.P R0 @.L1
JUMP.NE R14 @.L1
CALLI R13 @finish CALLI R13 @finish
.L1 .L1
LOADUI R1 0x1101 ; Write to TAPE_02 LOADUI R1 0x1101 ; Write to TAPE_02
FPUTC ; Print the Char FPUTC ; Print the Char
CALLI R13 @hex ; Convert it CALLI R13 @hex ; Convert it
CMPI R14 R0 0 ; Check if it is hex JUMP.NP R0 @loop ; Don't use nonhex chars
JUMP.L R14 @loop ; Don't use nonhex chars
JUMP.Z R11 @.L99 ; Jump if toggled JUMP.Z R11 @.L99 ; Jump if toggled
;; Process first byte of pair ;; Process first byte of pair