Created
January 23, 2011 16:50
-
-
Save jnthn/792205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "except_types.pasm" | |
.sub 'foo' | |
$P0 = box 1 | |
.return ($P0) | |
.end | |
.sub 'bar' | |
new $P424, ['ExceptionHandler'], .CONTROL_RETURN | |
set_addr $P424, control_423 | |
push_eh $P424 | |
$P0 = box 1 | |
.return ($P0) | |
control_423: | |
.local pmc exception | |
.get_results (exception) | |
getattribute $P428, exception, "payload" | |
.return ($P428) | |
.end | |
.sub 'test' :main | |
$N1 = time | |
say $N1 | |
$I0 = 0 | |
loop_1: | |
if $I0 > 10000000 goto loop_1_end | |
'foo'() | |
inc $I0 | |
goto loop_1 | |
loop_1_end: | |
$N1 = time | |
say $N1 | |
$I0 = 0 | |
loop_2: | |
if $I0 > 10000000 goto loop_2_end | |
'bar'() | |
inc $I0 | |
goto loop_2 | |
loop_2_end: | |
$N1 = time | |
say $N1 | |
.end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment