Skip to content

Instantly share code, notes, and snippets.

@macournoyer
Created March 31, 2009 19:24
Show Gist options
  • Save macournoyer/88355 to your computer and use it in GitHub Desktop.
Save macournoyer/88355 to your computer and use it in GitHub Desktop.
./tinyrb -d -e "1 + 2"
; block definition: 0x219f80 (level 0)
; 2 registers ; 0 nested blocks
; 0 args
.value 1 ; 0
.value 2 ; 1
[000] add 0 256 257
[001] return 0 0 0
; block end
./tinyrb -d -e "a = 1; a = a + 1"
; block definition: 0x218f80 (level 0)
; 3 registers ; 0 nested blocks
; 0 args
.local a ; 0
.value 1 ; 0
[000] loadk 0 0 0 ; R[0] = 1
[001] add 0 0 256
[002] return 0 0 0
; block end
x = 1
while x < 50000000
x = x + 1
end
; block definition: 0x218f80 (level 0)
; 3 registers ; 0 nested blocks
; 0 args
.local x ; 0
.value 1 ; 0
.value 50000000 ; 1
[000] loadk 0 0 0 ; R[0] = 1
[001] lt 1 0 257
[002] jmpunless 1 256 1
[003] add 0 0 256
[004] jmp 0 255 507 ; -4
[005] return 0 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment