diff --git a/src/waforth.wat b/src/waforth.wat index 9c39368..a44a994 100644 --- a/src/waforth.wat +++ b/src/waforth.wat @@ -17,9 +17,8 @@ (import "shell" "key" (func $shell_key (result i32))) ;; Load a webassembly module. - ;; Parameters: memory offset, size, table index where the new module will - ;; be loaded. - (import "shell" "load" (func $shell_load (param i32 i32 i32))) + ;; Parameters: memory offset, size + (import "shell" "load" (func $shell_load (param i32 i32))) ;; Generic signal to shell (import "shell" "call" (func $shell_call)) @@ -2192,8 +2191,7 @@ (then (drop (table.grow 0 (ref.func $!) (table.size 0))))) ;; Double size (call $shell_load (i32.const 0x1000 (; = MODULE_HEADER_BASE ;)) - (i32.sub (global.get $cp) (i32.const 0x1000 (; = MODULE_HEADER_BASE ;))) - (global.get $nextTableIndex)) + (i32.sub (global.get $cp) (i32.const 0x1000 (; = MODULE_HEADER_BASE ;)))) (global.set $nextTableIndex (i32.add (global.get $nextTableIndex) (i32.const 1)))) diff --git a/src/web/waforth.ts b/src/web/waforth.ts index ebdac49..90f41f6 100644 --- a/src/web/waforth.ts +++ b/src/web/waforth.ts @@ -132,7 +132,7 @@ class WAForth { // Loader //////////////////////////////////////// - load: (offset: number, length: number, index: number) => { + load: (offset: number, length: number) => { let data = new Uint8Array( (this.core!.exports.memory as WebAssembly.Memory).buffer, offset,