summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-02-28 23:59:42 +1100
committerkitty <nepeta@canaglie.net>2026-02-28 23:59:42 +1100
commitbf407e7b05d5459866420b5c05c7338904540263 (patch)
tree88d6430c2630f56bd49f7350f112807ce225b721
parentac052135a0a9347bc727b5aadba7e13d3a5c8c5b (diff)
cmove>
-rw-r--r--jefs.fs2
-rw-r--r--jefs.s12
2 files changed, 14 insertions, 0 deletions
diff --git a/jefs.fs b/jefs.fs
index a1757ca..48a77b9 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -1,5 +1,6 @@
\ i think something is going on with the stack. i dunno
\ things TODO:
+\ read-line (will be slow)
\ DO LOOP
\ s\"
\ add error handling to compiling words
@@ -272,6 +273,7 @@ variable hld
\ }}}
\ USER INPUT {{{
+\ use cmove (not cmove>) for moving stray bytes left when refilling
8192 constant file-buffer-length
make file-buffer file-buffer-length allot
\ }}}
diff --git a/jefs.s b/jefs.s
index cc75976..0a45c58 100644
--- a/jefs.s
+++ b/jefs.s
@@ -221,6 +221,18 @@ defword "cmove,", _cmove_comma, 0 ; ( c-addr u -- )
add r12, r9
mov qword [here], r12
ret
+
+defword "cmove>", cmove_to, 0 ; ( a1 a2 u -- )
+ std
+ pspop rcx
+ pspop rdi
+ add rdi, rcx
+ pspop rsi
+ add rsi, rcx
+
+ rep movsb
+ cld
+ ret
; }}}
; note: this puts the _address it itself pushes_ on the stack