From 30a97274bde7a1988d80861ab9b381148f3d19a7 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Tue, 29 Dec 2020 19:50:56 +0100 Subject: fix align values --- examples/example1a_blink_led_wasm/instructions.wat | 10 +++++----- examples/example2a_measure_time_wasm/instructions.wat | 6 +++--- examples/example2b_measure_time_wasm/instructions.wat | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'examples') diff --git a/examples/example1a_blink_led_wasm/instructions.wat b/examples/example1a_blink_led_wasm/instructions.wat index f231c13..4f56daf 100644 --- a/examples/example1a_blink_led_wasm/instructions.wat +++ b/examples/example1a_blink_led_wasm/instructions.wat @@ -7,29 +7,29 @@ ;; loop until timer exceeds 1500 (loop $again (br_if $again (i32.lt_u - (i32.load16_u offset=0x0 align=1 + (i32.load16_u offset=0x0 align=2 (i32.const 0x1BFC08)) (i32.const 1500)))) ;; now, light led2 - (i32.store16 offset=0x0 align=1 + (i32.store16 offset=0x0 align=2 (i32.const 0x1BFC06) (i32.const 0x1)) ;; loop until timer exceeds 3000 (loop $again (br_if $again (i32.lt_u - (i32.load16_u offset=0x0 align=1 + (i32.load16_u offset=0x0 align=2 (i32.const 0x1BFC08)) (i32.const 3000)))) ;; now, switch led2 off - (i32.store16 offset=0x0 align=1 + (i32.store16 offset=0x0 align=2 (i32.const 0x1BFC06) (i32.const 0x0)) ;; loop until timer exceeds 4500 (loop $again (br_if $again (i32.lt_u - (i32.load16_u offset=0x0 align=1 + (i32.load16_u offset=0x0 align=2 (i32.const 0x1BFC08)) (i32.const 4500))))) (export "main" (func $main))) diff --git a/examples/example2a_measure_time_wasm/instructions.wat b/examples/example2a_measure_time_wasm/instructions.wat index 3a6be34..01e081a 100644 --- a/examples/example2a_measure_time_wasm/instructions.wat +++ b/examples/example2a_measure_time_wasm/instructions.wat @@ -66,7 +66,7 @@ (local $adr i32) ;; reset the timer (although it should already be resetted, anyway...) - (i32.store16 offset=0x1BFC08 align=1 + (i32.store16 offset=0x1BFC08 align=2 (i32.const 0x0) (i32.const 0x0)) ;; initialize counter @@ -85,13 +85,13 @@ ;; we now leave sum on the stack for later ;; light led2 - (i32.store16 offset=0x1BFC06 align=1 + (i32.store16 offset=0x1BFC06 align=2 (i32.const 0x0) (i32.const 0x1)) ;; print timer value (set_local $adr (call $print ;; read timer value - (i32.load16_u offset=0x1BFC08 align=1 + (i32.load16_u offset=0x1BFC08 align=2 (i32.const 0x0)) (i32.const 0xFFC00))) diff --git a/examples/example2b_measure_time_wasm/instructions.wat b/examples/example2b_measure_time_wasm/instructions.wat index 6107b30..7c9bdbb 100644 --- a/examples/example2b_measure_time_wasm/instructions.wat +++ b/examples/example2b_measure_time_wasm/instructions.wat @@ -68,7 +68,7 @@ (local $adr i32) ;; reset the timer (although it should already be resetted, anyway...) - (i32.store16 offset=0x1BFC08 align=1 + (i32.store16 offset=0x1BFC08 align=2 (i32.const 0x0) (i32.const 0x0)) ;; initialize counter @@ -87,13 +87,13 @@ ;; we now leave sum on the stack for later ;; light led2 - (i32.store16 offset=0x1BFC06 align=1 + (i32.store16 offset=0x1BFC06 align=2 (i32.const 0x0) (i32.const 0x1)) ;; print timer value (set_local $adr (call $print ;; read timer value - (i32.load16_u offset=0x1BFC08 align=1 + (i32.load16_u offset=0x1BFC08 align=2 (i32.const 0x0)) (i32.const 0xFFC00))) -- cgit v1.2.3