Skip to content

Instantly share code, notes, and snippets.

@masak
Created July 11, 2010 12:46
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 masak/471521 to your computer and use it in GitHub Desktop.
Save masak/471521 to your computer and use it in GitHub Desktop.
# The below code represents `my $a = 3; while --$a { say my $b; say $a; $b = 42 }`.
$ cat example.sic
This is SIC v2010.08
block 'B0':
`lexvar '$a'
$0 = 3
store [0, 0], $0
`label L0
$1 = fetch [0, 0]
dec $1
store [0, 0], $1
jf $1, L1
$2 = closure-from-block 'B1'
call $2
jmp L0
`label L1
block 'B1':
`lexvar '$b'
$0 = fetch [0, 0]
say $0
$1 = fetch [-1, 0]
say $1
$2 = 42
store [0, 0], $2
$ perl6 new-runtime example.sic
Any()
2
Any()
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment