From 9b2e696e5e0f8c5d81172bdb7832b897f8c8f51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 2 Oct 2022 20:57:24 +0200 Subject: [PATCH] Improve documentation structure --- src/waforth.wat | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/waforth.wat b/src/waforth.wat index e7631a7..42fce82 100644 --- a/src/waforth.wat +++ b/src/waforth.wat @@ -180,20 +180,6 @@ (unreachable)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Function types - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; A regular compiled word is a function with only the - ;; top-of-stack pointer as parameter (and returns the new top-of-stack pointer) - ;; Arguments are passed via the stack. - (type $word (func (param i32) (result i32))) - - ;; Words with the 'data' flag set also get a pointer to data passed - ;; as second parameter. - (type $dataWord (func (param i32) (param i32) (result i32))) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function table ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -218,6 +204,18 @@ ;; END_DO_INDEX := 9 (table (export "table") 0xbf funcref) + ;; The function table contains 2 type of entries for: entries for + ;; regular compiled words, and entries for data words. + + ;; A regular compiled word is a function with only the + ;; top-of-stack pointer as parameter (and returns the new top-of-stack pointer) + ;; Arguments are passed via the stack. + (type $word (func (param i32) (result i32))) + + ;; Words with the 'data' flag set also get a pointer to data passed + ;; as second parameter. + (type $dataWord (func (param i32) (param i32) (result i32))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data @@ -2379,7 +2377,7 @@ (local.get $tos)) (data (i32.const 0x20ac0) "\b4\0a\02\00" "\01" "] " "\be\00\00\00") (elem (i32.const 0xbe) $right-bracket) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Interpreter state