From 99b0d29d403a3f57db8760282be6acbb6c8fe532 Mon Sep 17 00:00:00 2001 From: kitty Date: Wed, 25 Feb 2026 00:35:54 +1100 Subject: incomplete assembler displacement --- jefs.fs | 8 ++++++++ jefs.s | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/jefs.fs b/jefs.fs index cd605c1..3119591 100644 --- a/jefs.fs +++ b/jefs.fs @@ -66,6 +66,8 @@ variable modrm : rex.r rex @ 44 or rex ! ; : rex.x rex @ 42 or rex ! ; : rex.b rex @ 41 or rex ! ; +: rex, rex @ ?dup if c, then ; + \ REGISTERS {{{ : rax modrm @ 0 or modrm ! ; : rcx modrm @ 1 or modrm ! ; @@ -92,6 +94,12 @@ variable modrm : /4 modrm @ 20 or modrm ! ; : /5 modrm @ 28 or modrm ! ; : /6 modrm @ 30 or modrm ! ; : /7 modrm @ 38 or modrm ! ; +\ TODO store and write the displacement if given +: mod0 modrm @ 3f and modrm ! ; +: d) mod0 0<> if modrm @ 40 or modrm ! then ; \ disp8 or 0 only for now + +: mov, rex, 8b c, modrm @ c, asm$ ; + \ example idea: (from execute below) \ rex.w r11, r14 0 d) mov, \ rex.w r14, r14 8 d) lea, diff --git a/jefs.s b/jefs.s index f5032a7..7820b78 100644 --- a/jefs.s +++ b/jefs.s @@ -6,9 +6,6 @@ mov qword [r14], %1 %endmacro -; this feels like Too much code and probably Too slow to have for every pspop. -; we'll see -; clobbers r8 (which isn't actually used anywhere here) %macro pspop 1 mov %1, qword [r14] lea r14, [r14+8] -- cgit v1.2.3