summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--quine.asm27
1 files changed, 23 insertions, 4 deletions
diff --git a/quine.asm b/quine.asm
index 5419cd2..df771db 100644
--- a/quine.asm
+++ b/quine.asm
@@ -6254,6 +6254,18 @@ cold_start:
   dq litstring, "exit", early_find, entry_to_execution_token, early_comma
   dq early_here, fetch, lit, 8, packalign, early_here_store
 
+  ; In:
+  ;   pointer to input buffer metadata
+  ; Out:
+  ;   pointer to input buffer "next-source" field
+  dq litstring, "input-buffer-next-source", 0, early_create
+  dq early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 5*8, 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
+
   ;   Given an initialized buffer (input or otherwise), sets its logical-start
   ; and logical-length fields to indicate the buffer is empty. This relies on
   ; the buffer having a backing store attached, but does not alter the backing
@@ -6319,13 +6331,20 @@ cold_start:
   dq lit, 0, early_comma
   dq litstring, "swap", early_find, entry_to_execution_token, early_comma
   dq litstring, "!", early_find, entry_to_execution_token, early_comma
-  ; Notice the absence of a dup this time.
+  dq litstring, "dup", early_find, entry_to_execution_token, early_comma
   dq litstring, "input-buffer-refill", early_find, entry_to_execution_token
   dq early_comma
   dq litstring, "lit", early_find, entry_to_execution_token, early_comma
   dq lit, 0, early_comma
   dq litstring, "swap", early_find, entry_to_execution_token, early_comma
   dq litstring, "!", early_find, entry_to_execution_token, early_comma
+  ; Notice the absence of a dup this time.
+  dq litstring, "input-buffer-next-source", 0, early_find
+  dq entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0, early_comma
+  dq litstring, "swap", 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
 
@@ -6337,7 +6356,7 @@ cold_start:
   dq litstring, "allocate-input-buffer-metadata", early_create
   dq early_docol_codeword
   dq litstring, "lit", early_find, entry_to_execution_token, early_comma
-  dq lit, 5*8, early_comma
+  dq lit, 6*8, early_comma
   dq litstring, "allocate", 0, early_find, entry_to_execution_token
   dq early_comma
   dq litstring, "dup", early_find, entry_to_execution_token, early_comma
@@ -6356,7 +6375,7 @@ cold_start:
   dq litstring, "allocate-input-buffer", early_create, early_docol_codeword
   dq litstring, "dup", early_find, entry_to_execution_token, early_comma
   dq litstring, "lit", early_find, entry_to_execution_token, early_comma
-  dq lit, 5*8, early_comma
+  dq lit, 6*8, early_comma
   dq litstring, "+", early_find, entry_to_execution_token, early_comma
   dq litstring, "allocate", 0, early_find, entry_to_execution_token
   dq early_comma
@@ -6367,7 +6386,7 @@ cold_start:
   dq litstring, "dup", 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
-  dq lit, 5*8, early_comma
+  dq lit, 6*8, early_comma
   dq litstring, "+", early_find, entry_to_execution_token, early_comma
   ; (capacity in bytes, metadata pointer, metadata pointer, physical start)
   dq litstring, "swap", early_find, entry_to_execution_token, early_comma