diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-04-21 00:04:28 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-04-21 00:04:28 -0700 |
| commit | 5d8c9d601d93b7c8dc740921c39b3ca410702b81 (patch) | |
| tree | f4805766da30e6e44bca46e53983061cd9eb2224 | |
| parent | e49e80fd5a261a6f16dc38b23761e7834106f39c (diff) | |
oops, it checks integer syntax now
oops :) so the no-such-word error condition can happen now, which is good Force-Push: yes Change-Id: If0095253c0c247ea7ff13a9b6b49a5698ef8243f
| -rw-r--r-- | quine.asm | 103 |
1 files changed, 84 insertions, 19 deletions
diff --git a/quine.asm b/quine.asm index 908031d..70ae3fb 100644 --- a/quine.asm +++ b/quine.asm @@ -2734,7 +2734,7 @@ cold_start: dq early_here, fetch, lit, 8, packalign, early_here_store ; This was "dotbase_unsigned" - dq litstring, "dotbase-unsigned", 0, early_create, early_docol_codeword + dq litstring, ".base-unsigned", early_create, early_docol_codeword dq litstring, "3unroll", early_find, entry_to_execution_token, early_comma dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "2dup", early_find, entry_to_execution_token, early_comma @@ -2813,7 +2813,8 @@ cold_start: dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dotbase", early_create, early_docol_codeword + ; This was "dotbase". + dq litstring, ".base", early_create, early_docol_codeword dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "dup", early_find, entry_to_execution_token, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma @@ -2831,64 +2832,70 @@ cold_start: dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 0, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dot", early_create, early_docol_codeword + ; This was "dot". + dq litstring, ".", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 10, early_comma - dq litstring, "dotbase", early_find, entry_to_execution_token, early_comma + dq litstring, ".base", early_find, entry_to_execution_token, early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dothex", early_create, early_docol_codeword + ; This was "dothex". + dq litstring, ".hex", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 0, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dothex8", early_create, early_docol_codeword + ; This was "dothex8". + dq litstring, ".hex8", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 2, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dothex16", 0, early_create, early_docol_codeword + ; This was "dothex16". + dq litstring, ".hex16", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 4, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dothex32", 0, early_create, early_docol_codeword + ; This was "dothex32". + dq litstring, ".hex32", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 8, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store - dq litstring, "dothex64", 0, early_create, early_docol_codeword + ; This was "dothex64". + dq litstring, ".hex64", early_create, early_docol_codeword dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 16, early_comma - dq litstring, "dotbase-unsigned", 0, early_find, entry_to_execution_token + dq litstring, ".base-unsigned", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store @@ -5742,7 +5749,7 @@ cold_start: dq litstring, "emitstring", early_find, entry_to_execution_token, early_comma dq litstring, "dup", early_find, entry_to_execution_token, early_comma dq litstring, "@", early_find, entry_to_execution_token, early_comma - dq litstring, "dothex64", 0, early_find, entry_to_execution_token + dq litstring, ".hex64", early_find, entry_to_execution_token dq early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 8, early_comma @@ -5848,7 +5855,7 @@ cold_start: dq litstring, "drop", early_find, entry_to_execution_token, early_comma dq litstring, "dup", early_find, entry_to_execution_token, early_comma dq litstring, "@", early_find, entry_to_execution_token, early_comma - dq litstring, "dot", early_find, entry_to_execution_token, early_comma + dq litstring, ".", early_find, entry_to_execution_token, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 8, early_comma dq litstring, "+", early_find, entry_to_execution_token, early_comma @@ -6752,6 +6759,33 @@ cold_start: dq lit, 1, early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma + ; If the first byte is less than "0", this is an error. + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, "0", early_comma + dq litstring, ">", early_find, entry_to_execution_token, early_comma + dq litstring, "0branch", early_find, entry_to_execution_token, early_comma + dq lit, 6*8, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, 1, early_comma + dq litstring, "exit", early_find, entry_to_execution_token, early_comma + + ; If the first byte is greater than "9", this is an error. + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, "9", early_comma + dq litstring, "<", early_find, entry_to_execution_token, early_comma + dq litstring, "0branch", early_find, entry_to_execution_token, early_comma + dq lit, 6*8, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, 1, early_comma + dq litstring, "exit", early_find, entry_to_execution_token, early_comma + + ; The first byte is a valid digit, so let's get started. dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, "0", early_comma dq litstring, "-", early_find, entry_to_execution_token, early_comma @@ -6774,6 +6808,36 @@ cold_start: dq lit, 0, early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma + ; If the latest character is less than "0", that's an error. + ; (result so far, current point in string, latest byte) + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, "0", early_comma + dq litstring, ">", early_find, entry_to_execution_token, early_comma + dq litstring, "0branch", early_find, entry_to_execution_token, early_comma + dq lit, 7*8, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, 1, early_comma + dq litstring, "exit", early_find, entry_to_execution_token, early_comma + + ; If the latest character is greater than "9", that's an error. + ; (result so far, current point in string, latest byte) + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, "9", early_comma + dq litstring, "<", early_find, entry_to_execution_token, early_comma + dq litstring, "0branch", early_find, entry_to_execution_token, early_comma + dq lit, 7*8, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "drop", early_find, entry_to_execution_token, early_comma + dq litstring, "lit", early_find, entry_to_execution_token, early_comma + dq lit, 1, early_comma + dq litstring, "exit", early_find, entry_to_execution_token, early_comma + ; (result so far, current point in string, latest byte) dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, "0", early_comma @@ -6785,10 +6849,11 @@ cold_start: dq litstring, "+", early_find, entry_to_execution_token, early_comma dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "branch", early_find, entry_to_execution_token, early_comma - dq lit, -22*8, early_comma + dq lit, -46*8, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store + dq litstring, "read-decimal", early_create, early_docol_codeword dq litstring, "dup", early_find, entry_to_execution_token, early_comma dq litstring, "unpack8", early_find, entry_to_execution_token, early_comma @@ -10455,7 +10520,7 @@ defword self_raw, 0 defword foo, 0 dq docol, litstring, "ia ia ftaghn", emitstring, exit defword boot_source, 0 - dq "6 7 * dot" + dq "6 7 * ." dq 0 ; Routines that traverse the raw code need a way to guess where the end of a |