Added wasm target

This commit is contained in:
2025-03-12 23:15:43 +01:00
parent 450e634d79
commit dc664dbf5a
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})
}