diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-04-27 00:41:04 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-04-27 00:41:04 -0700 |
| commit | 7bc794cc9028c4171a761bdea4cd4766a4ec9214 (patch) | |
| tree | 0e3fcb3fe3169231dccedff18ca6413f38af0b18 | |
| parent | 9a4ee220b12fded33fc5e0b1d055df0b0e890a3f (diff) | |
now we have string literals! yay :)
Force-Push: yes Change-Id: Ie797f38a0b83096a960d1f0019f5322a1f7884c3
| -rw-r--r-- | quine.asm | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/quine.asm b/quine.asm index 7286da3..753d206 100644 --- a/quine.asm +++ b/quine.asm @@ -11245,6 +11245,17 @@ defword boot_source, 0x40 dq ": align-floor dup 3unroll /% swap drop * ; " + ; Let's have strings now. + dq ": s"" " + dq " interpreter-flags @ 1 & " + dq " { ' litstring entry-to-execution-token , } if " + dq " here @ key { dup dup 34 != && } { pack8 key } while " + dq " drop dup 0 pack8 " + dq " interpreter-flags @ 1 & " + dq " { 8 packalign here ! } " + dq " { drop here @ } if-else " + dq " ; make-immediate " + ; Some output formatting tools. dq ": space 32 value@ emitstring drop ; " dq ": newline 10 value@ emitstring drop ; " @@ -11272,7 +11283,9 @@ defword boot_source, 0x40 dq ": guess-entry-end " dq " dup entry-flags@ 64 & 64 = { exit } if " - dq " dup next-newer-entry dup { drop exit } unless " + dq " dup next-newer-entry dup " + dq " { drop dup is-in-heap { drop here @ } { drop } if-else " + dq " exit } unless " dq " swap drop ; " dq ": word-heading " @@ -11296,7 +11309,7 @@ defword boot_source, 0x40 ; (end, start) dq ": show-hex-between " dq " dup 16 1- invert & " - dq " { dup 3 pick >= } " + dq " { dup 3 pick > } " dq " { 3dup show-hex-row 16 + } while 3 ndrop ; " dq ": describe " @@ -11304,6 +11317,10 @@ defword boot_source, 0x40 dq " dup guess-entry-end swap entry-to-execution-token " dq " show-hex-between ; " + dq ": describe-all " + dq " oldest-entry { dup } " + dq " { dup describe next-newer-entry } while drop ; " + ;dq ": foo 5 { dup } " ;dq " { 4 indent 97 value@ emitstring drop newline 1- } " ;dq " while drop ; foo " @@ -11312,8 +11329,11 @@ defword boot_source, 0x40 ;dq ": foo { 5 . } forever ; foo ' foo forget " ;dq ": foo 0 { dup 5 > } { dup . 1+ } while drop ; foo ' foo forget " + ;dq "s"" foo"" value@ emitstring dropstring " + ;dq ": foo s"" zotzotza"" emitstring ; ' foo describe " + ;dq "s"" zotzotza"" emitstring stack " ;dq "list-dictionary " - dq "' indent describe " + ;dq "describe-all " dq " " ; TODO define ( ... ) comments |