protoverse

A metaverse protocol
git clone git://jb55.com/protoverse
Log | Files | Refs | README | LICENSE

loop.wat (655B)


      1 (module
      2 	(func $add (param $lhs i32) (param $rhs i32) (result i32)
      3 	      local.get $lhs
      4 	      local.get $rhs
      5 	      i32.add)
      6 	(func $sub (param $lhs i32) (param $rhs i32) (result i32)
      7 	      local.get $lhs
      8 	      local.get $rhs
      9 	      i32.sub
     10 	      )
     11 	(func $start (result i32)
     12 	      (local i32 i32)
     13 	      i32.const 0
     14 	      local.set 0
     15 	      block
     16 	        loop
     17 	          local.get 0
     18 		  i32.const 1
     19 		  i32.add
     20 		  local.set 0
     21 	          i32.const 4
     22 		  local.get 0
     23 	          i32.gt_u
     24 	          br_if 0
     25 	        end
     26 	      end
     27 	      i32.const 0
     28 	      )
     29 	(export "start" (func $start))
     30 	(export "add" (func $add))
     31 	(export "sub" (func $sub)))