summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--quine.asm78
1 files changed, 75 insertions, 3 deletions
diff --git a/quine.asm b/quine.asm
index 5ecc29e..a63ae02 100644
--- a/quine.asm
+++ b/quine.asm
@@ -1909,6 +1909,78 @@ cold_start:
   dq early_r0, litstring, "r0", early_defvar
   dq early_latest, litstring, "latest", early_defvar
   dq early_here, litstring, "here", early_defvar
+
+  ;;; For triage's sake, here's an inventory of everything else in the file.
+  ;;;
+  ;;; Macros:
+  ;;;   next, beforenext, pushcontrol, popcontrol
+  ;;; Assembly:
+  ;;;   docol (the constant, and the actual codeword implementation)
+  ;;;     needs a label
+  ;;;     pushcontrol, next
+  ;;;   exit
+  ;;;     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
+  ;;;   lit, litstring
+  ;;;   store, fetch
+  ;;;   addstore, substore, store8, fetch8, store16, fetch16, store32, fetch32
+  ;;;   ccopy, stringlen
+  ;;;     no dependencies except next for any of these
+  ;;;   branch, zbranch
+  ;;;     sorta needs a label but might be avoidable
+  ;;;     needs next
+  ;;; Forth:
+  ;;;   pack64, pack32, pack16, pack8, packstring, packalign
+  ;;;     only the basics above
+  ;;; Assembly:
+  ;;;   litpack64, litpack32, litpack16, litpack8
+  ;;;     beforenext, pack*
+  ;;; Forth:
+  ;;;   rax, rcx, dx, rbx, rsp, rbp, rsi, rdi
+  ;;;   r8, r9, r10, r11, r12, r13, r14, r15
+  ;;;     only the basics above
+  ;;;   reg64, extrareg64
+  ;;;     only the basics plus optional emitstring and sys_exit
+  ;;;     (notice that these are forward references!)
+  ;;;   rex_w, rex_wb, opcodereg, modrm
+  ;;;     only the basics above
+  ;;;   cld, mov_reg64_imm64, mov_reg64_reg64, push_reg64, lodsq
+  ;;;   jmp_abs_indirect_reg64, syscall
+  ;;;     basics plus assembly helpers
+  ;;; 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_defvar
+  ;;;
+  ;;; It's likely that nothing past this point is required for the heap copy,
+  ;;; but it's here for completeness.
+  ;;;
+  ;;; Forth, subject to reconsideration:
+  ;;;   quit
+  ;;;     quine, sys_exit (these are forward references)
+  ;;; Assembly:
+  ;;;   sys_exit, sys_write
+  ;;;     nothing special
+  ;;; Forth:
+  ;;;   emitstring
+  ;;;     stringlen, sys_write, basics
+  ;;;   quine
+  ;;;     early_here (removable), all_contents (forward)
+  ;;;     sys_write, basics
+  ;;;   use_label, set_label
+  ;;;     only basics
+  ;;; Assembly:
+  ;;;   hlt
+  ;;;     nothing
+  ;;; Forth:
+  ;;;   all_contents, elf_file_header, elf_program_header
+  ;;;   output_start_routine
+  ;;;     nothing special in any of these (they do want use/set_label)
+  ;;;   self_raw
+  ;;;     self-reference
+  ;;;
   dq quit
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2559,7 +2631,7 @@ zbranch_after_jmp:
 
 
 ;;;;;;;;;;;;;;;;;;;;;;
-;;; Ouptut helpers ;;;
+;;; Output helpers ;;;
 ;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;;   These routines are for building up data structures in-memory. Sometimes
@@ -2782,7 +2854,7 @@ defword push_reg64, 0
 defword lodsq, 0
   dq docol, rex_w, lit, 0xAD, pack8, exit
 
-defword jmp_abs_indirect_qreg, 0
+defword jmp_abs_indirect_reg64, 0
   dq docol
   dq swap, lit, 0xFF, pack8, swap
   dq reg64, lit, 0, lit, 4, roll3, modrm
@@ -2922,7 +2994,7 @@ defword early_here_store, 0
 ; Stack out:
 ;   new base address
 defword pack_next, 0
-  dq docol, lodsq, rax, jmp_abs_indirect_qreg, exit
+  dq docol, lodsq, rax, jmp_abs_indirect_reg64, exit
 
 ; Stack in:
 ;   heap address