37 lines
1,000 B
Plaintext
37 lines
1,000 B
Plaintext
(module
|
|
(data "mouse")
|
|
(data "x")
|
|
(data "y")
|
|
(func $rma (import "host" "read_mem_addr")(param i32)(result i32))
|
|
(func $co (import "host" "create_object")(param i32 i32)(result i64))
|
|
(func $roa (import "host" "read_object_attribute")(param i64 i32 i32)(result i32 i32))
|
|
(memory (export "memory") 1)
|
|
|
|
(func
|
|
(export "start")(result i64)
|
|
;; Copy into memory the object name
|
|
(memory.init 0
|
|
(i32.const 0) ;; target offset
|
|
(i32.const 0) ;; source offset
|
|
(i32.const 5))
|
|
(memory.init 1
|
|
(i32.const 6) ;; target offset
|
|
(i32.const 0) ;; source offset
|
|
(i32.const 1))
|
|
(memory.init 2
|
|
(i32.const 7) ;; target offset
|
|
(i32.const 0) ;; source offset
|
|
(i32.const 1))
|
|
|
|
i32.const 0
|
|
i32.const 5
|
|
call $co
|
|
|
|
;; i32.const 6
|
|
;; i32.const 1
|
|
|
|
;; call $roa
|
|
|
|
)
|
|
)
|