From a41c6444d30f9ad561d95a1776f796581338df16 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 28 Aug 2026 22:21:52 -0700 Subject: make read-to-buffer take its delimiter as a parameter since the recommended invocation to build Evocation (hehe) does the heavy lifting in interpreted mode, this required a new helper, allocate-string, which takes a string in the scratch space and properly allocates it so it won't be overwritten by future allocations Force-Push: yes Change-Id: Ia73612a65fd7c11af5fe110c573c23c16b777112 --- quine.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'quine.asm') diff --git a/quine.asm b/quine.asm index f11b435..28f97d1 100644 --- a/quine.asm +++ b/quine.asm @@ -6255,6 +6255,31 @@ cold_start: dq litstring, "exit", early_find, entry_to_execution_token, early_comma dq early_here, fetch, lit, 8, packalign, early_here_store + ; Takes a string pointer which must be equal to the current value of + ; "here", ; indicating it is in the temporary allocation space, and + ; allocates it permanently by advancing "here" to the next aligned address + ; after it. + ; + ; In: + ; string pointer + ; Out: + ; string pointer + dq litstring, "allocate-string", early_create, early_docol_codeword + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "dup", early_find, entry_to_execution_token, early_comma + dq litstring, "stringlen", 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, "+", 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, "packalign", early_find, entry_to_execution_token, early_comma + dq litstring, "here", early_find, entry_to_execution_token, early_comma + dq litstring, "!", 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 + ; In: ; pointer to buffer metadata ; Out: -- cgit 1.4.1