Added wasm target
This commit is contained in:
11
src/wasm/CPU.go
Normal file
11
src/wasm/CPU.go
Normal 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
13
src/wasm/WASM.go
Normal 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})
|
||||
}
|
Reference in New Issue
Block a user