summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-04-09 20:23:32 -0700
committerIrene Knapp <ireneista@irenes.space>2026-04-09 20:23:32 -0700
commit3294314eb1b23878f4fd71784c4c40ecdf147e4c (patch)
treeede6df97e7d327dd962810191f0efe12433f42df
parent5d4e964417e90eb880144dc566f08935dd07ba33 (diff)
add more MOV variants (oops), also some more instructions
Force-Push: yes
Change-Id: I7cd521188642c63820f3b71c8bd1faf532b6962d
-rw-r--r--quine.asm220
1 files changed, 209 insertions, 11 deletions
diff --git a/quine.asm b/quine.asm
index 43538ab..915eafa 100644
--- a/quine.asm
+++ b/quine.asm
@@ -4346,6 +4346,21 @@ 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 "mov_reg8_indirect_reg64".
+  dq litstring, "mov-reg8-reg8", early_create, early_docol_codeword
+  dq litstring, "3roll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x88, early_comma
+  dq litstring, "pack8", early_find, entry_to_execution_token, early_comma
+  dq litstring, "3unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "reg8", early_find, entry_to_execution_token, early_comma
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "addressing-reg8", early_find, entry_to_execution_token
+  dq 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 "mov_reg8_disp8_reg64".
   dq litstring, "mov-reg8-disp8-reg64", early_create, early_docol_codeword
   dq litstring, "lit", early_find, entry_to_execution_token, early_comma
@@ -4365,6 +4380,188 @@ 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_disp8_reg64".
+  dq litstring, "lea-reg64-disp8-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-disp8-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
+  dq lit, 5, 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, 5, 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, 4, early_comma
+  dq litstring, "unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "3unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "addressing-indexed-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_disp8_indexed_reg64".
+  dq litstring, "lea-reg64-disp8-indexed-reg64", early_create
+  dq early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 6, 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, 6, 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, 5, early_comma
+  dq litstring, "unroll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 3, early_comma
+  dq litstring, "roll", 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, "roll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 3, early_comma
+  dq litstring, "roll", early_find, entry_to_execution_token, early_comma
+  dq litstring, "addressing-disp8-indexed-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 "push_reg64".
+  dq litstring, "push-reg64", early_create, early_docol_codeword
+  dq litstring, "reg64", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x50, early_comma
+  dq litstring, "opcodereg", 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 "pop_reg64".
+  dq litstring, "pop-reg64", early_create, early_docol_codeword
+  dq litstring, "reg64", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x58, early_comma
+  dq litstring, "opcodereg", 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 push_imm32_extended64".
+  dq litstring, "push-imm32-extended64", early_create, early_docol_codeword
+  dq litstring, "swap", early_find, entry_to_execution_token, early_comma
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x68, early_comma
+  dq litstring, "pack8", 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
+
+  dq litstring, "movs8", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xA4, early_comma
+  dq litstring, "pack8", 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
+
+  dq litstring, "movs16", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0x66, 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, 0xA5, early_comma
+  dq litstring, "pack8", 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
+
+  dq litstring, "movs32", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xA5, early_comma
+  dq litstring, "pack8", 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
+
+  dq litstring, "movs64", early_create, early_docol_codeword
+  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, 0xA5, early_comma
+  dq litstring, "pack8", 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 "rep_movs8".
+  dq litstring, "rep-movs8", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xF3, 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, 0xA4, early_comma
+  dq litstring, "pack8", 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 "rep_movs16".
+  dq litstring, "rep-movs16", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xF3, 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, 0x66, 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, 0xA5, early_comma
+  dq litstring, "pack8", 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 "rep_movs32".
+  dq litstring, "rep-movs32", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xF3, 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, 0xA5, early_comma
+  dq litstring, "pack8", 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 "rep_movs64".
+  dq litstring, "rep-movs64", early_create, early_docol_codeword
+  dq litstring, "lit", early_find, entry_to_execution_token, early_comma
+  dq lit, 0xF3, early_comma
+  dq litstring, "pack8", 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, 0xA5, early_comma
+  dq litstring, "pack8", 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
+
   dq early_describe_all, lit, 0, sys_exit
 
   ;;; For triage's sake, here's an inventory of everything else in the file.
@@ -4443,12 +4640,13 @@ cold_start:
   ;;;   mov_reg16_indirect_reg64, mov_reg16_disp8_reg64,
   ;;;   mov_indirect_reg64_reg8, mov_disp8_reg64_reg8,
   ;;;   mov_reg8_indirect_reg64, mov_reg8_disp8_reg64,
-  ;;;   TODO this is as far as the copy-to-heap implementations have gotten
+  ;;;   move_reg8_reg8,
   ;;;   lea_reg64_disp8_reg64, lea_reg64_indexed_reg64,
   ;;;   lea_reg64_disp8_indexed_reg64,
   ;;;   push_reg64, pop_reg64, push_imm32_extended,
   ;;;   movs8, movs16, movs32, movs64,
   ;;;   rep_movs8, rep_movs16, rep_movs32, rep_movs64,
+  ;;;   TODO this is as far as the copy-to-heap implementations have gotten
   ;;;   lods8, lods16, lods32, lods64,
   ;;;   rep_lods8, rep_lods16, rep_lods32, rep_lods64,
   ;;;   stos8, stos16, stos32, stos64,
@@ -6459,6 +6657,16 @@ defword mov_reg8_disp8_reg64, 0
 ; Stack:
 ;   output point
 ;   source register name
+;   target register name
+defword mov_reg8_reg8, 0
+  dq docol
+  dq roll3, lit, 0x88, pack8, unroll3
+  dq swap, reg8, swap, addressing_reg8
+  dq exit
+
+; Stack:
+;   output point
+;   source register name
 ;   source displacement value
 ;   target register name
 defword lea_reg64_disp8_reg64, 0
@@ -6496,16 +6704,6 @@ defword lea_reg64_disp8_indexed_reg64, 0
 ; Stack:
 ;   output point
 ;   source register name
-;   target register name
-defword mov_reg8_reg8, 0
-  dq docol
-  dq roll3, lit, 0x88, pack8, unroll3
-  dq swap, reg8, swap, addressing_reg8
-  dq exit
-
-; Stack:
-;   output point
-;   source register name
 defword push_reg64, 0
   dq docol, reg64, lit, 0x50, opcodereg, exit