Create initial emulator and hello world demo
This commit is contained in:
22
wipforth.wat
Normal file
22
wipforth.wat
Normal file
@@ -0,0 +1,22 @@
|
||||
(module
|
||||
(import "emu" "mem" (memory 1 1 shared))
|
||||
|
||||
(func (export "reset")
|
||||
;; Write message into TXBUF
|
||||
(i32.store8 (i32.const 0x0) (i32.const 0x48)) ;; H
|
||||
(i32.store8 (i32.const 0x1) (i32.const 0x65)) ;; e
|
||||
(i32.store8 (i32.const 0x2) (i32.const 0x6c)) ;; l
|
||||
(i32.store8 (i32.const 0x3) (i32.const 0x6c)) ;; l
|
||||
(i32.store8 (i32.const 0x4) (i32.const 0x6f)) ;; o
|
||||
(i32.store8 (i32.const 0x5) (i32.const 0x2c)) ;; ,
|
||||
(i32.store8 (i32.const 0x6) (i32.const 0x20)) ;; <space>
|
||||
(i32.store8 (i32.const 0x7) (i32.const 0x77)) ;; w
|
||||
(i32.store8 (i32.const 0x8) (i32.const 0x6f)) ;; o
|
||||
(i32.store8 (i32.const 0x9) (i32.const 0x72)) ;; r
|
||||
(i32.store8 (i32.const 0xa) (i32.const 0x6c)) ;; l
|
||||
(i32.store8 (i32.const 0xb) (i32.const 0x64)) ;; d
|
||||
(i32.store8 (i32.const 0xc) (i32.const 0x21)) ;; !
|
||||
|
||||
;; Update TXTAIL and set TXDATA
|
||||
(i32.atomic.store8 (i32.const 0x42) (i32.const 0xd))
|
||||
(i32.atomic.store8 (i32.const 0x40) (i32.const 0xff))))
|
||||
Reference in New Issue
Block a user