From 8f339f837f5a6a38d47691327f32d1f5a3675930 Mon Sep 17 00:00:00 2001 From: kitty Date: Sat, 14 Feb 2026 19:34:57 +1100 Subject: branch!! --- jefs.s | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'jefs.s') diff --git a/jefs.s b/jefs.s index 71854b4..05598a0 100644 --- a/jefs.s +++ b/jefs.s @@ -117,6 +117,14 @@ defword ",", comma, 0 mov qword [here], r12 ret +defword "d,", d_comma, 0 + pspop r11 + mov r12, [here] + mov dword [r12], r11d + add r12, 4 + mov qword [here], r12 + ret + defword "w,", w_comma, 0 pspop r11 mov r12, [here] @@ -543,8 +551,8 @@ defword "+", plus, 0 defword "-", minus, 0 pspop r11 pspop r12 - sub r11, r12 - pspush r11 + sub r12, r11 + pspush r12 ret defword "*", _times, 0 @@ -616,6 +624,18 @@ defword "immediate", immediate, 0 mov byte [r12], r13b ret +; e9 [00 00 00 00] relative 32 bit immediate, relative to *instruction after jump*! +; note: the dummy value must be provided *by the calling word* +defword "branch", branch, 0 + mov r12, [here] + mov byte [r12], 0xe9 + inc r12 + mov qword [here], r12 + ret + +; defword "0branch", zerobranch, 0 +; ret + ; TEMPORARY HORRIBLE DEBUGGING BULLSHIT {{{ ; debugging word; outputs raw bytes so needs to be piped through `x(x)d` ; terrible and awful -- cgit v1.2.3