Indent loops, ifs etc
This commit is contained in:
50
wipforth.wat
50
wipforth.wat
@@ -586,13 +586,13 @@
|
|||||||
(func $key (local $head i32)
|
(func $key (local $head i32)
|
||||||
;; Wait for RXBUF to be non-empty
|
;; Wait for RXBUF to be non-empty
|
||||||
loop $wait
|
loop $wait
|
||||||
global.get $RXHEAD
|
global.get $RXHEAD
|
||||||
i32.atomic.load8_u
|
i32.atomic.load8_u
|
||||||
local.tee $head
|
local.tee $head
|
||||||
global.get $RXTAIL
|
global.get $RXTAIL
|
||||||
i32.atomic.load8_u
|
i32.atomic.load8_u
|
||||||
i32.eq
|
i32.eq
|
||||||
br_if $wait
|
br_if $wait
|
||||||
end
|
end
|
||||||
|
|
||||||
;; Read byte at head position
|
;; Read byte at head position
|
||||||
@@ -616,18 +616,18 @@
|
|||||||
(func $emit (local $tail i32) (local $next i32)
|
(func $emit (local $tail i32) (local $next i32)
|
||||||
;; Wait for TXBUF to be non-full
|
;; Wait for TXBUF to be non-full
|
||||||
loop $wait
|
loop $wait
|
||||||
global.get $TXTAIL
|
global.get $TXTAIL
|
||||||
i32.atomic.load8_u
|
i32.atomic.load8_u
|
||||||
local.tee $tail
|
local.tee $tail
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
i32.const 0x1f
|
i32.const 0x1f
|
||||||
i32.and
|
i32.and
|
||||||
local.tee $next
|
local.tee $next
|
||||||
global.get $TXHEAD
|
global.get $TXHEAD
|
||||||
i32.atomic.load8_u
|
i32.atomic.load8_u
|
||||||
i32.eq
|
i32.eq
|
||||||
br_if $wait
|
br_if $wait
|
||||||
end
|
end
|
||||||
|
|
||||||
;; Write byte at tail position
|
;; Write byte at tail position
|
||||||
@@ -657,10 +657,10 @@
|
|||||||
(func $zbranch
|
(func $zbranch
|
||||||
call $pop
|
call $pop
|
||||||
if (result i32)
|
if (result i32)
|
||||||
i32.const 4
|
i32.const 4
|
||||||
else
|
else
|
||||||
global.get $ip
|
global.get $ip
|
||||||
i32.load
|
i32.load
|
||||||
end
|
end
|
||||||
global.get $ip
|
global.get $ip
|
||||||
i32.add
|
i32.add
|
||||||
@@ -1685,9 +1685,9 @@
|
|||||||
|
|
||||||
(func $trampoline
|
(func $trampoline
|
||||||
loop $loop
|
loop $loop
|
||||||
global.get $fn
|
global.get $fn
|
||||||
call_indirect (type $codeword)
|
call_indirect (type $codeword)
|
||||||
br $loop
|
br $loop
|
||||||
end)
|
end)
|
||||||
|
|
||||||
(func (export "reset")
|
(func (export "reset")
|
||||||
|
|||||||
Reference in New Issue
Block a user