Update documentation

This commit is contained in:
Remko Tronçon 2022-05-23 21:49:57 +02:00
parent ce54272eb6
commit ff84035919

View file

@ -11,13 +11,19 @@
;; module) ;; module)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; I/O ;; Write a character to the output device
(import "shell" "emit" (func $shell_emit (param i32))) (import "shell" "emit" (func $shell_emit (param i32)))
;; Read input from input device
;; Parameters: target address, maximum size
;; Returns: number of bytes read
(import "shell" "read" (func $shell_read (param i32 i32) (result i32))) (import "shell" "read" (func $shell_read (param i32 i32) (result i32)))
;; Read a single key from the input device
(import "shell" "key" (func $shell_key (result i32))) (import "shell" "key" (func $shell_key (result i32)))
;; Load a webassembly module. ;; Load a webassembly module.
;; Parameters: memory offset, size ;; Parameters: WASM bytecode memory offset, size
(import "shell" "load" (func $shell_load (param i32 i32))) (import "shell" "load" (func $shell_load (param i32 i32)))
;; Generic signal to shell ;; Generic signal to shell
@ -28,12 +34,13 @@
;; Function types ;; Function types
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A regular compiled word is a function without any parameters. ;; A regular compiled word is a function with only the
;; (arguments are passed via the stack) ;; top-of-stack pointer as parameter (and return the new top-of-stack pointer)
;; Arguments are passed via the stack.
(type $word (func (param i32) (result i32))) (type $word (func (param i32) (result i32)))
;; Words with the 'data' flag set get a pointer to data passed ;; Words with the 'data' flag set also get a pointer to data passed
;; as parameter. ;; as second parameter.
(type $dataWord (func (param i32) (param i32) (result i32))) (type $dataWord (func (param i32) (param i32) (result i32)))