summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-07 23:17:53 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-07 23:17:53 -0700
commit7f152cff58934c6e34c68887cba6afb167371298 (patch)
treee344c9e6f4f09002611a5d18a3b00244950bfa30
parentee399e457a26223b18b98007404e48531dc21430 (diff)
oops. didn't have a fully bootstrapped lea-reg64-disp32-reg64.
the cold-start routine needs it...

Force-Push: yes
Change-Id: I6c0d80fc2bbb634f4b25aa96bd4ed5351361b8c9
-rw-r--r--quine.asm83
1 files changed, 83 insertions, 0 deletions
diff --git a/quine.asm b/quine.asm
index 2386a82..6941bfb 100644
--- a/quine.asm
+++ b/quine.asm
@@ -3979,6 +3979,40 @@ cold_start:
   dq litstring, "exit", early_find, entry_to_execution_token, early_comma
   dq early_here, fetch, lit, 8, packalign, early_here_store
 
+  ; This was "addressing_disp32_reg64".
+  dq litstring, "addressing-disp32-reg64", early_create
+  dq 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, ":rsp", 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, 5, early_comma
+  dq litstring, "unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 4, early_comma
+  dq litstring, "unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "reg64", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 2, early_comma
+  dq litstring, "3unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "modrm", early_find, entry_to_execution_token, early_comma
+  dq litstring, "3roll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "0branch", early_find, entry_to_execution_token, early_comma
+  dq lit, 8*8, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 4, early_comma
+  dq litstring, ":rsp", early_find, entry_to_execution_token, early_comma
+  dq litstring, "reg64", early_find, entry_to_execution_token, early_comma
+  dq litstring, "sib", early_find, entry_to_execution_token, early_comma
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "pack32", 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
+
   ; This was "addressing_indexed_reg64".
   dq litstring, "addressing-indexed-reg64", 0, early_create
   dq early_docol_codeword
@@ -4511,6 +4545,25 @@ cold_start:
   dq litstring, "exit", early_find, entry_to_execution_token, early_comma
   dq early_here, fetch, lit, 8, packalign, early_here_store
 
+  ; This was "lea_reg64_disp32_reg64".
+  dq litstring, "lea-reg64-disp32-reg64", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 4, early_comma
+  dq litstring, "roll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "rex-w", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x8D, early_comma
+  dq litstring, "pack8", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 4, early_comma
+  dq litstring, "unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "reg64", early_find, entry_to_execution_token, early_comma
+  dq litstring, "3unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "addressing-disp32-reg64", early_find
+  dq 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
+
   ; This was "lea_reg64_indexed_reg64".
   dq litstring, "lea-reg64-indexed-reg64", early_create, early_docol_codeword
   dq litstring, "lit", early_find, entry_to_execution_token, early_comma
@@ -9799,6 +9852,25 @@ defword addressing_disp8_reg64, 0
 ; Stack:
 ;   output point
 ;   reg/op field value (raw number)
+;   reg/mem field register name
+;   displacement value
+defword addressing_disp32_reg64, 0
+  dq docol
+  ; This mode can do rbp fine, so no need to check for that.
+  ; Check whether the R/M register is rsp; save the test result for later.
+  dq swap, dup, rsp, eq, lit, 5, unroll, swap
+  ; Stash the displacement value out of the way, too.
+  dq lit, 4, unroll
+  dq reg64, lit, 2, unroll3, modrm
+  ; If the R/M register was rsp, we need an SIB byte; otherwise, skip it.
+  dq roll3, zbranch, 8*8, lit, 0, lit, 4, rsp, reg64, sib
+  ; The displacement value.
+  dq swap, pack32
+  dq exit
+
+; Stack:
+;   output point
+;   reg/op field value (raw number)
 ;   scale factor, as a count of bytes
 ;   index register name
 ;   base field register name
@@ -10097,6 +10169,17 @@ defword lea_reg64_disp8_reg64, 0
 
 ; Stack:
 ;   output point
+;   source register name
+;   source displacement value
+;   target register name
+defword lea_reg64_disp32_reg64, 0
+  dq docol
+  dq lit, 4, roll, rex_w, lit, 0x8D, pack8, lit, 4, unroll
+  dq reg64, unroll3, addressing_disp32_reg64
+  dq exit
+
+; Stack:
+;   output point
 ;   source base register name
 ;   source index register name
 ;   source index scale factor, as a count of bytes