2023-04-07 16:44:33 -05:00
|
|
|
(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
|
2023-04-12 13:08:07 -05:00
|
|
|
(export "start")(result i64)
|
2023-04-07 16:44:33 -05:00
|
|
|
;; 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
|
|
|
|
|
2023-04-12 13:08:07 -05:00
|
|
|
;; i32.const 6
|
|
|
|
;; i32.const 1
|
2023-04-07 16:44:33 -05:00
|
|
|
|
2023-04-12 13:08:07 -05:00
|
|
|
;; call $roa
|
2023-04-07 16:44:33 -05:00
|
|
|
|
|
|
|
)
|
|
|
|
)
|