Skip to content

Instantly share code, notes, and snippets.

@kpmy
Created April 24, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpmy/86b5b438f6e67a5f4ca673fc5c4b3cab to your computer and use it in GitHub Desktop.
Save kpmy/86b5b438f6e67a5f4ca673fc5c4b3cab to your computer and use it in GitHub Desktop.
(module
(memory 1 1)
(import $print "spectest" "print"
(param i32))
(func $start
(local $p i32)
(local $v i32)
(set_local $v
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.add
(get_local $v)
(i32.const 1)))
(i32.store8
(get_local $p)
(get_local $v))
(call_import $print
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.add
(get_local $v)
(i32.const 1)))
(i32.store8
(get_local $p)
(get_local $v))
(call_import $print
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.add
(get_local $v)
(i32.const 1)))
(i32.store8
(get_local $p)
(get_local $v))
(call_import $print
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.add
(get_local $v)
(i32.const 1)))
(i32.store8
(get_local $p)
(get_local $v))
(call_import $print
(i32.load8_u
(get_local $p)))
(set_local $p
(i32.add
(get_local $p)
(i32.const 1)))
(set_local $v
(i32.load8_u
(get_local $p)))
(set_local $v
(i32.add
(get_local $v)
(i32.const 1)))
(i32.store8
(get_local $p)
(get_local $v))
(call_import $print
(i32.load8_u
(get_local $p)))
(set_local $p
(i32.add
(get_local $p)
(i32.const -1)))
(call_import $print
(i32.load8_u
(get_local $p)))
(i32.store8
(get_local $p)
(i32.add
(i32.load8_u
(get_local $p))
(i32.const -1)))
(call_import $print
(i32.load8_u
(get_local $p))))
(start $start))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment