summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-04-08 19:31:19 -0700
committerIrene Knapp <ireneista@irenes.space>2026-04-08 19:31:19 -0700
commit3eb34e894de079234ca7c8b764c390d6471c4248 (patch)
treea4c592c9fa2973537921bc25a9d3e88700955536
parent786da04fbd52177a43f337060833debaeb3737cb (diff)
update the "map" of stuff that needs to be copied to the heap
a lot of small utilities got added or reorganized as part of writing the debug code. the map now reflects the current state both of what's been implemented in flatassembler, and what has a copy-to-heap implementation

Force-Push: yes
Change-Id: I749cd1814e4b9e5360b68a77461849b345b16559
-rw-r--r--quine.asm91
1 files changed, 82 insertions, 9 deletions
diff --git a/quine.asm b/quine.asm
index fdf55c9..e16471e 100644
--- a/quine.asm
+++ b/quine.asm
@@ -2654,20 +2654,36 @@ cold_start:
   ;;;     popcontrol, next
   ;;;   swap, drop, drop2, roll, unroll, roll3, unroll3, dup, dup2
   ;;;   add, sub, mul, divmod
-  ;;;   eq, ne, gt, lt, ge, le, and, or, xor, invert
+  ;;;   eq, ne, gt, lt, ge, le
+  ;;;   gt_unsigned, lt_unsigned, ge_unsigned, le_unsigned
+  ;;;   and, or, xor, invert
   ;;;   lit, litstring
   ;;;   store, fetch
+  ;;;   fetch_control_stack, store_control_stack
+  ;;;     TODO needs heap impl
+  ;;;   fetch_value_stack, store_value_stack
+  ;;;     TODO needs heap impl
   ;;;   addstore, substore, store8, fetch8, store16, fetch16, store32, fetch32
   ;;;   memcopy, stringlen
+  ;;;   reverse_stringlen, reverse_padding_len
+  ;;;     TODO needs heap impl
+  ;;;   stringcmp
+  ;;;     TODO needs heap impl
   ;;;     no dependencies except next for any of these
   ;;;   branch, zbranch
   ;;;     sorta needs a label but might be avoidable
   ;;;     needs next
+  ;;;   execute
+  ;;;     TODO needs heap impl
   ;;;   sys_exit, sys_write
   ;;;     nothing special
   ;;; Forth:
   ;;;   emitstring
   ;;;     stringlen, sys_write, basics
+  ;;;   dot dothex dothex8 dothex16 dothex32 dothex64 dotbase dotbase_unsigned
+  ;;;     TODO needs heap impl
+  ;;;   pow logfloor logceil
+  ;;;     TODO needs heap impl
   ;;; Assembly:
   ;;;   crash
   ;;;     nothing special
@@ -2677,8 +2693,9 @@ cold_start:
   ;;; Assembly:
   ;;;   litpack64, litpack32, litpack16, litpack8
   ;;;     beforenext, pack*
+  ;;; TODO this is as far as the copy-to-heap implementations above have gotten
   ;;; Forth:
-  ;;;   rax, rcx, dx, rbx, rsp, rbp, rsi, rdi
+  ;;;   rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi
   ;;;   r8, r9, r10, r11, r12, r13, r14, r15
   ;;;   eax, ecx, edx, ebx, esp, ebp, esi, edi
   ;;;   ax, cx, dx, bx, sp, bp, si, di
@@ -2698,7 +2715,7 @@ cold_start:
   ;;;   cld, std, mov_reg64_imm64, mov_extrareg64_imm64, mov_reg64_reg64,
   ;;;   mov_indirect_reg64_reg64, mov_disp8_reg64_reg64,
   ;;;   mov_reg64_indirect_reg64, mov_reg64_disp8_reg64,
-  ;;;   mov_reg64_indexed_reg64,
+  ;;;   mov_reg64_indexed_reg64, mov_indexed_reg64_reg64,
   ;;;   mov_indirect_reg64_reg32, mov_disp8_reg64_reg32,
   ;;;   mov_reg32_indirect_reg64, mov_reg32_disp8_reg64,
   ;;;   mov_indirect_reg64_reg16, mov_disp8_reg64_reg16,
@@ -2708,21 +2725,75 @@ cold_start:
   ;;;   lea_reg64_disp8_reg64, lea_reg64_indexed_reg64,
   ;;;   lea_reg64_disp8_indexed_reg64,
   ;;;   push_reg64, pop_reg64,
-  ;;;   lodsq, rep_movs8, rep_mov16, rep_movs32, rep_movs64, repnz_scas8,
+  ;;;   movs8, movs16, movs32, movs64,
+  ;;;   rep_movs8, rep_movs16, rep_movs32, rep_movs64,
+  ;;;   lods8, lods16, lods32, lods64,
+  ;;;   rep_lods8, rep_lods16, rep_lods32, rep_lods64,
+  ;;;   stos8, stos16, stos32, stos64,
+  ;;;   rep_stos8, rep_stos16, rep_stos32, rep_stos64,
+  ;;;   cmps8, cmps16, cmps32, cmps64,
+  ;;;   repz_cmps8, repz_cmps16, repz_cmps32, repz_cmps64,
+  ;;;   repnz_cmps8, repnz_cmps16, repnz_cmps32, repnz_cmps64,
+  ;;;   scas8, scas16, scas32, scas64,
+  ;;;   repz_scas8, repz_scas16, repz_scas32, repz_scas64,
+  ;;;   repnz_scas8, repnz_scas16, repnz_scas32, repnz_scas64,
   ;;;   add_reg64_reg64, add_indirect_reg64_reg64, add_reg64_indirect_reg64,
   ;;;   add_reg64_imm8,
   ;;;   sub_reg64_reg64, sub_indirect_reg64_reg64,
-  ;;;   mul_reg64_reg64, divmod_reg64, idivmod_reg64, inc_reg64, dec_reg64,
-  ;;;   and_reg64_reg64, or_reg64_reg64, or_reg64_imm8, xox_reg64_reg64,
+  ;;;   mul_reg64, divmod_reg64, idivmod_reg64, inc_reg64, dec_reg64,
+  ;;;   and_reg64_reg64, and_reg64_imm8,
+  ;;;   or_reg64_reg64, or_reg64_imm8,
+  ;;;   xox_reg64_reg64,
   ;;;   not_reg64,
   ;;;   cmp_reg64_reg64, test_reg64_reg64,
-  ;;;   set_reg8_cc, jmp_cc_rel_imm8, jmp_abs_indirect_reg64, jmp_rel_imm32,
+  ;;;   set_reg8_cc, jmp_cc_rel_imm8, jmp_cc_rel_im32,
+  ;;;   jmp_abs_indirect_reg64, jmp_rel_imm8, jmp_rel_imm32,
   ;;;   syscall, hlt
   ;;;     basics plus assembly helpers
+  ;;; TODO this next stuff is way more interleaved than it needs to be
   ;;; Forth, not needed on heap:
   ;;;   early_heap, early_s0, early_r0, early_latest, early_here
-  ;;;   early_create, early_comma, early_self_codeword, early_here_store,
-  ;;;   pack_next, early_variable
+  ;;;   early_find
+  ;;;     find_in
+  ;;; Forth, needed on heap:
+  ;;;   find_in
+  ;;; Forth, not needed on heap:
+  ;;;   early_next_newer_entry
+  ;;;     next_newer_entry_in
+  ;;; Forth, needed on heap:
+  ;;;   next_newer_entry_in,
+  ;;;   entry_to_execution_token,
+  ;;;   fetch_entry_flags,
+  ;;;   store_entry_flags,
+  ;;;   entry_to_name,
+  ;;; Forth, not needed on heap:
+  ;;;   early_guess_entry_end
+  ;;; Forth, needed on heap:
+  ;;;   guess_entry_end_in
+  ;;;   execution_token_to_entry
+  ;;; Forth, not needed on heap:
+  ;;;   early_show_source
+  ;;; Forth, needed on heap:
+  ;;;   show_source_between
+  ;;; Forth, not needed on heap:
+  ;;;   early_show_hex
+  ;;; Forth, needed on heap:
+  ;;;   show_hex_between
+  ;;; Forth, not needed on heap:
+  ;;;   early_show_source_or_hex
+  ;;; Forth, needed on heap:
+  ;;;   show_source_or_hex_between
+  ;;; Forth, not needed on heap:
+  ;;;   early_describe
+  ;;;   early_describe_all
+  ;;; Forth, needed on heap:
+  ;;; Forth, not needed on heap:
+  ;;;   early_create, early_comma, early_self_codeword, early_docol_codeword,
+  ;;;   early_here_store,
+  ;;; Forth, needed on heap:
+  ;;;   pack_next, pack_beforenext, pack_pushcontrol, pack_popcontrol,
+  ;;; Forth, not needed on heap:
+  ;;;   early_variable
   ;;;
   ;;; It's likely that nothing past this point is required for the heap copy,
   ;;; but it's here for completeness.
@@ -2742,6 +2813,8 @@ cold_start:
   ;;;     nothing special in any of these (they do want use/set_label)
   ;;;   self_raw
   ;;;     self-reference
+  ;;; Not a real word:
+  ;;;   end_segment
   ;;;
   dq quit