summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2025-10-11 19:59:16 -0700
committerIrene Knapp <ireneista@irenes.space>2025-10-11 19:59:16 -0700
commit5fc2871f2ced6ac718685bad4729994441d6c832 (patch)
treedac8ce1d2bc60075a2a8aa4d5dfffbf83087e88a
parente6048584116fbc1ea0a53298b2807cc9b7d8c4d0 (diff)
generalized mov.qreg.qreg HEAD main
Force-Push: yes
Change-Id: I668a2738ac19e98dd30c58964ba4c6706613ea7d
-rw-r--r--quine.asm17
1 files changed, 5 insertions, 12 deletions
diff --git a/quine.asm b/quine.asm
index b7904da..abc709b 100644
--- a/quine.asm
+++ b/quine.asm
@@ -110,17 +110,11 @@ end macro
 
 
 macro mov.qreg.qreg target, source
-  match =rsi, target
-    match =rsp, source
-      rex.w
-      db 0x89
-      modrm 3, 4, 6
-    else
-      assert 0
-    end match
-  else
-    assert 0
-  end match
+  qwordreg treg, target
+  qwordreg sreg, source
+  rex.w
+  db 0x89
+  modrm 3, sreg, treg
 end macro
 
 
@@ -404,7 +398,6 @@ _start:
   ;;;
   mov.rel.q rsp, 0x60, rdx                 ; size in file
   mov.rel.q rsp, 0x68, rdx                 ; size in memory
-    ; TODO it works for rax source but not yet for rdx
 
   ;;;
   ;;; The buffer is ready; output the file.