Revised stage0 monitor with several minor improvements and updated checksums

This commit is contained in:
Jeremiah Orians 2016-10-29 07:45:23 -04:00
parent 73651b577e
commit d7bab06902
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
4 changed files with 94 additions and 84 deletions

View File

@ -7,6 +7,7 @@
** Changed ** Changed
+ Renamed xeh1 files to match current naming standard + Renamed xeh1 files to match current naming standard
+ created roms/ to store previously built roms and expanded .gitignore to prevent binary blobs from being checked in. + created roms/ to store previously built roms and expanded .gitignore to prevent binary blobs from being checked in.
+ Revised stage0 Monitor to utilize ANDI and updated the Hex0 version to incorporate the enhancements made previously
** Fixed ** Fixed
+ Fixed leading char bug in M0 + Fixed leading char bug in M0

View File

@ -13,7 +13,7 @@
** stage0 ** stage0
| Filename | compiled binary sha256sum | compiled binary sha1sum | compiled binary md5sum | | Filename | compiled binary sha256sum | compiled binary sha1sum | compiled binary md5sum |
|---------------------+------------------------------------------------------------------+------------------------------------------+----------------------------------| |---------------------+------------------------------------------------------------------+------------------------------------------+----------------------------------|
| stage0_monitor.hex0 | 7314d72708a732a16c566344d9aa3711a80c62405324fc7e12703cad02741a67 | cb2cad1bc77b3bdaee72852cf994bfd30655da9c | 960c6143076d522af176de82257514cc | | stage0_monitor.hex0 | 0a427b14020354d1c785f5f900677e0059fce8f8d4456e9c19e5528cb17101eb | 1365da633f268f551424c621535bd94cfc6bf85b | f0890d7a69ed38f1fc5aa79d6f35c095 |
** stage1 ** stage1
| Filename | compiled binary sha256sum | compiled binary sha1sum | compiled binary md5sum | | Filename | compiled binary sha256sum | compiled binary sha1sum | compiled binary md5sum |

View File

@ -1,109 +1,119 @@
# start # :start
2D2A000f # LOADUI R10 0x0F ; Byte mask 2D2B0001 # LOADUI R11 1 ; Our toggle
2D2B0001 # LOADUI R11 1 ; Our toggle 2D2D0600 # LOADUI R13 0x600 ; Where we are starting our Stack
2D2D0600 # LOADUI R13 0x600 ; Where we are starting our Stack # ;; R14 will be storing our condition
# ;; R14 will be storing our condition 0D00002F # FALSE R15 ; Our holder
0D00002F # FALSE R15 ; Our holder
# ;; Prep TAPE_01 # ;; Prep TAPE_01
2D201100 # LOADUI R0 0x1100 2D201100 # LOADUI R0 0x1100
42100001 # FOPEN_WRITE 42100001 # FOPEN_WRITE
# ;; Prep TAPE_02 # ;; Prep TAPE_02
2D201101 # LOADUI R0 0x1101 2D201101 # LOADUI R0 0x1101
42100001 # FOPEN_WRITE 42100001 # FOPEN_WRITE
# loop # :loop
2D210000 # LOADUI R1 0 ; Read from tty 2D210000 # LOADUI R1 0 ; Read from tty
42100100 # FGETC ; Read a Char 42100100 # FGETC ; Read a Char
A030000d # CMPSKIPI.NE R0 13 ; Replace all CR
2D20000a # LOADUI R0 10 ; WIth LF
42100200 # FPUTC ; Display the Char to User
# ;; Check for Ctrl-D # ;; Check for Ctrl-D
1FE00004 # CMPUI R14 R0 4 A0300004 # CMPSKIPI.NE R0 4
2C6E0008 # JUMP.NE R14 @.L0 3C0000d0 # JUMP @finish
2D0D00c8 # CALLI R13 @finish
# .L0
# ;; Check for EOF # ;; Check for EOF
2CB00008 # JUMP.P R0 @.L1 2CC000cc # JUMP.NP R0 @finish
2D0D00c0 # 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
2D0D0034 # CALLI R13 @hex ; Convert it 2D0D0034 # CALLI R13 @hex ; Convert it
2CC0ffd8 # JUMP.NP R0 @loop ; Don't use nonhex chars 2CC0ffd4 # JUMP.NP R0 @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 B0F0000f # ANDI R15 R0 0x0F ; Store First nibble
0D00002B # FALSE R11 ; Flip the toggle 0D00002B # FALSE R11 ; Flip the toggle
3C00ffc8 # JUMP @loop 3C00ffc4 # JUMP @loop
# .L99 # :.L99
2D5F0004 # SL0I R15 4 ; Shift our first nibble 2D5F0004 # SL0I R15 4 ; Shift our first nibble
0502000A # AND R0 R0 R10 ; Mask out top B000000f # ANDI R0 R0 0x0F ; Mask out top
0500000F # ADD R0 R0 R15 ; Combine nibbles 0500000F # ADD R0 R0 R15 ; Combine nibbles
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
3C00ffac # JUMP @loop ; Try to get more bytes 3C00ffa8 # JUMP @loop ; Try to get more bytes
# hex # :hex
# ;; Deal with line comments starting with # # ;; Deal with line comments starting with #
1FE00023 # CMPUI R14 R0 35 1FE00023 # CMPUI R14 R0 35
2C5E0060 # JUMP.E R14 @ascii_comment 2C5E0060 # JUMP.E R14 @ascii_comment
# ;; Deal with line comments starting with ; # ;; Deal with line comments starting with ;
1FE0003b # CMPUI R14 R0 59 1FE0003b # CMPUI R14 R0 59
2C5E0058 # JUMP.E R14 @ascii_comment 2C5E0058 # JUMP.E R14 @ascii_comment
# ;; Deal with all ascii less than '0' # ;; Deal with all ascii less than '0'
1FE00030 # CMPUI R14 R0 48 1FE00030 # CMPUI R14 R0 48
2C8E0048 # JUMP.L R14 @ascii_other 2C8E0048 # JUMP.L R14 @ascii_other
# ;; Deal with '0'-'9' # ;; Deal with '0'-'9'
1FE00039 # CMPUI R14 R0 57 1FE00039 # CMPUI R14 R0 57
2C7E0028 # JUMP.LE R14 @ascii_num 2C7E0028 # JUMP.LE R14 @ascii_num
# ;; Deal with all ascii less than 'A' # ;; Deal with all ascii less than 'A'
1FE00041 # CMPUI R14 R0 65 1FE00041 # CMPUI R14 R0 65
2C8E0038 # JUMP.L R14 @ascii_other 2C8E0038 # JUMP.L R14 @ascii_other
# ;; Deal with 'A'-'F' # ;; Deal with 'A'-'F'
1FE00046 # CMPUI R14 R0 70 1FE00046 # CMPUI R14 R0 70
2C7E0028 # JUMP.LE R14 @ascii_high 2C7E0028 # JUMP.LE R14 @ascii_high
# ;; Deal with all ascii less than 'a' # ;; Deal with all ascii less than 'a'
1FE00061 # CMPUI R14 R0 97 1FE00061 # CMPUI R14 R0 97
2C8E0028 # JUMP.L R14 @ascii_other 2C8E0028 # JUMP.L R14 @ascii_other
# ;; Deal with 'a'-'f' # ;; Deal with 'a'-'f'
1FE00066 # CMPUI R14 R0 102 1FE00066 # CMPUI R14 R0 102
2C7E0010 # JUMP.LE R14 @ascii_low 2C7E0010 # JUMP.LE R14 @ascii_low
# ;; Ignore the rest # ;; Ignore the rest
3C00001c # JUMP @ascii_other 3C00001c # JUMP @ascii_other
# ascii_num # :ascii_num
11000030 # SUBUI R0 R0 48 11000030 # SUBUI R0 R0 48
0D01001D # RET R13 0D01001D # RET R13
# ascii_low # :ascii_low
11000057 # SUBUI R0 R0 87 11000057 # SUBUI R0 R0 87
0D01001D # RET R13 0D01001D # RET R13
# ascii_high # :ascii_high
11000037 # SUBUI R0 R0 55 11000037 # SUBUI R0 R0 55
0D01001D # RET R13 0D01001D # RET R13
# ascii_other # :ascii_other
0D000030 # TRUE R0 0D000030 # TRUE R0
0D01001D # RET R13 0D01001D # RET R13
# ascii_comment # :ascii_comment
2D210000 # LOADUI R1 0 ; Read from tty 2D210000 # LOADUI R1 0 ; Read from tty
42100100 # FGETC ; Read another char 42100100 # FGETC ; Read another char
1FE0000a # CMPUI R14 R0 10 ; Stop at the end of line A030000d # CMPSKIPI.NE R0 13 ; Replace all CR
2D211101 # LOADUI R1 0x1101 ; Write to TAPE_02 2D20000a # LOADUI R0 10 ; WIth LF
42100200 # FPUTC ; The char we just read 42100200 # FPUTC ; Let the user see it
2C6Effec # JUMP.NE R14 @ascii_comment ; Otherwise keep looping 1FE0000a # CMPUI R14 R0 10 ; Stop at the end of line
3C00ffe0 # JUMP @ascii_other 2D211101 # LOADUI R1 0x1101 ; Write to TAPE_02
42100200 # FPUTC ; The char we just read
2C6Effe0 # JUMP.NE R14 @ascii_comment ; Otherwise keep looping
3C00ffd4 # JUMP @ascii_other
# finish # :finish
2D201100 # LOADUI R0 0x1100 ; Close TAPE_01 2D201100 # LOADUI R0 0x1100 ; Close TAPE_01
42100002 # FCLOSE 42100002 # FCLOSE
2D201101 # LOADUI R0 0x1101 ; Close TAPE_02 2D201101 # LOADUI R0 0x1101 ; Close TAPE_02
42100002 # FCLOSE 42100002 # FCLOSE
FFFFFFFF # HALT FFFFFFFF # HALT

View File

@ -1,5 +1,4 @@
:start :start
LOADUI R10 0x0F ; Byte mask
LOADUI R11 1 ; Our toggle LOADUI R11 1 ; Our toggle
LOADUI R13 0x600 ; Where we are starting our Stack LOADUI R13 0x600 ; Where we are starting our Stack
;; R14 will be storing our condition ;; R14 will be storing our condition
@ -37,13 +36,13 @@
JUMP.Z R11 @.L99 ; Jump if toggled JUMP.Z R11 @.L99 ; Jump if toggled
;; Process first byte of pair ;; Process first byte of pair
AND R15 R0 R10 ; Store First nibble ANDI R15 R0 0x0F ; Store First nibble
FALSE R11 ; Flip the toggle FALSE R11 ; Flip the toggle
JUMP @loop JUMP @loop
:.L99 :.L99
SL0I R15 4 ; Shift our first nibble SL0I R15 4 ; Shift our first nibble
AND R0 R0 R10 ; Mask out top ANDI R0 R0 0x0F ; Mask out top
ADD R0 R0 R15 ; Combine nibbles ADD R0 R0 R15 ; Combine nibbles
LOADI R11 1 ; Flip the toggle LOADI R11 1 ; Flip the toggle
LOADUI R1 0x1100 ; Write the combined byte LOADUI R1 0x1100 ; Write the combined byte