From 7f152cff58934c6e34c68887cba6afb167371298 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 7 May 2026 23:17:53 -0700 Subject: oops. didn't have a fully bootstrapped lea-reg64-disp32-reg64. the cold-start routine needs it... Force-Push: yes Change-Id: I6c0d80fc2bbb634f4b25aa96bd4ed5351361b8c9 --- quine.asm | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) 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 @@ -9796,6 +9849,25 @@ defword addressing_disp8_reg64, 0 dq swap, pack8 dq exit +; 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) @@ -10095,6 +10167,17 @@ defword lea_reg64_disp8_reg64, 0 dq reg64, unroll3, addressing_disp8_reg64 dq exit +; 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 -- cgit 1.4.1