From 51e63deb372598185562858dbcb744114e2b1359 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 9 May 2026 20:29:14 -0700 Subject: implement "create" in interpret.e memmove never had a heap-based implementation, probably due to excessive hurrying when it was first written. it has now been added. it's identical to the original static implementation. a minor documentation error in evoke.e was discovered while coding this, and is now fixed. Force-Push: yes Change-Id: I55ff09712a992410167a53cd83e96a452ed49744 --- quine.asm | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'quine.asm') diff --git a/quine.asm b/quine.asm index e86e61c..12a45f8 100644 --- a/quine.asm +++ b/quine.asm @@ -2459,6 +2459,27 @@ cold_start: dq rdx, rsi, mov_reg64_reg64 dq pack_next, lit, 8, packalign, early_here_store + dq litstring, "memmove", early_create, early_self_codeword + dq early_here, fetch + dq rsi, rdx, mov_reg64_reg64 + dq rcx, pop_reg64 + dq rsi, pop_reg64 + dq rdi, pop_reg64 + dq rsi, rax, mov_reg64_reg64 + dq rdi, rax, cmp_reg64_reg64 + dq lit, 4, cc_below, jmp_cc_rel_imm8 + dq rep_movs8 + dq lit, 16, jmp_rel_imm8 + dq rcx, rsi, add_reg64_reg64 + dq rsi, dec_reg64 + dq rcx, rdi, add_reg64_reg64 + dq rdi, dec_reg64 + dq std + dq rep_movs8 + dq cld + dq rdx, rsi, mov_reg64_reg64 + dq pack_next, lit, 8, packalign, early_here_store + dq litstring, "stringlen", early_create, early_self_codeword dq early_here, fetch dq rdi, pop_reg64 @@ -11790,14 +11811,14 @@ defword boot_source, 0x40 ; We'll have logical and real soon now, be patient... :) dq ": is-in-heap dup heap @ <= swap here @ > & ; " - dq ": unlink-pre-heap-words " - dq " latest @ " - dq " dup { dup is-in-heap 0 = { drop exit } if } " - dq " { drop exit } if-else " - dq " { dup @ is-in-heap } { @ } while " - dq " 0 swap ! ; " +; dq ": unlink-pre-heap-words " +; dq " latest @ " +; dq " dup { dup is-in-heap 0 = { drop exit } if } " +; dq " { drop exit } if-else " +; dq " { dup @ is-in-heap } { @ } while " +; dq " 0 swap ! ; " ; Do it immediately, so that we don't accidentally rely on any of that. - dq "unlink-pre-heap-words " + ;dq "unlink-pre-heap-words " ; Now some fancier stack combinators. ; -- cgit 1.4.1