Added wasm target

This commit is contained in:
Eduard Urbach 2025-03-12 23:15:43 +01:00
parent 6e738d2c9f
commit 296fc37265
Signed by: eduard
GPG key ID: 49226B848C78F6C8
8 changed files with 44 additions and 4 deletions

11
src/wasm/CPU.go Normal file
View file

@ -0,0 +1,11 @@
package wasm
import "git.urbach.dev/cli/q/src/cpu"
var (
CPU = cpu.CPU{
Input: []cpu.Register{0, 1, 2, 3, 4, 5},
Output: []cpu.Register{0, 1, 2, 3, 4, 5},
NumRegisters: 0,
}
)

13
src/wasm/WASM.go Normal file
View file

@ -0,0 +1,13 @@
package wasm
import (
"io"
)
const HeaderEnd = 8
// Write writes the WASM format to the given writer.
func Write(writer io.Writer, codeBytes []byte, dataBytes []byte) {
writer.Write([]byte{0x00, 0x61, 0x73, 0x6D})
writer.Write([]byte{0x01, 0x00, 0x00, 0x00})
}