Higher Subleq | Error | Output | Subleq | ITR |
int a=1, b=0;
int f(int a)
{
__out a;
return 1;
}
void main()
{
if( a || b==2 ) __out 50;
if( a==1 || b ) __out 51;
f(52) || f(53);
}
|
|
234
|
top:top top sqmain
. _a:1 _b:0
_f:
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; bp 0
bp; sp bp
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t1 0
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t2 0
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t3 0
t1; t2; bp t1; c1 t1; t1 t2
t1; t3; ?+11; t2 Z; Z ?+4; Z; 0 t1; t1 t3
t3 (-1)
ax; dec ax
Z Z end_f
end_f:
?+8; sp ?+4; t3; 0 t3; inc sp
?+8; sp ?+4; t2; 0 t2; inc sp
?+8; sp ?+4; t1; 0 t1; inc sp
sp; bp sp
?+8; sp ?+4; bp; 0 bp; inc sp
?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
_main:
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; bp 0
bp; sp bp
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t1 0
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t2 0
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t3 0
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; t4 0
t1; _a Z; Z t1 ?+3; Z Z ?+9; Z; _a t1; _a t1
t2; inc t2; Z t1 ?+3; Z Z l1
t3; _b Z; Z t3; Z; c4 t3 ?+3
t3 t3 ?+9; t3 Z ?+3; Z Z ?+3; inc t3
Z t3 ?+3; Z Z l1; t2;
l1:
Z t2 l2
c2 (-1)
l2:
t1; _a Z; Z t1; Z; dec t1 ?+3
t1 t1 ?+9; t1 Z ?+3; Z Z ?+3; inc t1
t2; inc t2; Z t1 ?+3; Z Z l3
t3; _b Z; Z t3 ?+3; Z Z ?+9; Z; _b t3; _b t3
Z t3 ?+3; Z Z l3; t2;
l3:
Z t2 l4
c5 (-1)
l4:
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+9; sp ?+5; c6 Z; Z 0; Z
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; ?+2 0 _f; . ?;
t1; ax t1
c1 sp
t2; t1 Z; Z t2 ?+3; Z Z ?+9; Z; t1 t2; t1 t2
t1; inc t1; Z t2 ?+3; Z Z l5
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+9; sp ?+5; c7 Z; Z 0; Z
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; ?+2 0 _f; . ?;
t3; ax t3
c1 sp
t4; t3 Z; Z t4 ?+3; Z Z ?+9; Z; t3 t4; t3 t4
Z t4 ?+3; Z Z l5; t1;
l5:
?+8; sp ?+4; t4; 0 t4; inc sp
?+8; sp ?+4; t3; 0 t3; inc sp
?+8; sp ?+4; t2; 0 t2; inc sp
?+8; sp ?+4; t1; 0 t1; inc sp
sp; bp sp
?+8; sp ?+4; bp; 0 bp; inc sp
?+8; sp ?+4; ?+7; 0 ?+3; Z Z 0
sqmain:
dec sp; ?+11; sp ?+7; ?+6; sp ?+2; 0
?+6; sp ?+2; ?+2 0 _main; . ?; inc sp
Z Z (-1)
. c1:-2 c3:0 c4:2 c2:50 c5:51 c6:52 c7:53
. t1:0 t2:0 t3:0 t4:0
. inc:-1 Z:0 dec:1 ax:0 bp:0 sp:-sp
|
Root (mg_25_1.hsq:16)
Declaration (mg_25_1.hsq:1)
Keyword [int] (mg_25_1.hsq:1)
Declarator [=] (mg_25_1.hsq:1)
Id [a] (mg_25_1.hsq:1)
Const [1] (mg_25_1.hsq:1)
Declarator [=] (mg_25_1.hsq:1)
Id [b] (mg_25_1.hsq:1)
Const [0] (mg_25_1.hsq:1)
Function:0 [f] (mg_25_1.hsq:3)
Keyword [int] (mg_25_1.hsq:3)
Param-type-list (mg_25_1.hsq:3)
Stackvar:-2 [a] (mg_25_1.hsq:3)
Block (mg_25_1.hsq:4)
OperatorIO [__out] (mg_25_1.hsq:5)
Unary [*] (mg_25_1.hsq:5) a:3
Additive [+] (mg_25_1.hsq:5) a:3
Variable [@bp] (mg_25_1.hsq:5) a:3
Const [-2] (mg_25_1.hsq:5) a:3
Keyword-statement [return] (mg_25_1.hsq:6)
Const [1] (mg_25_1.hsq:6)
Function:0 [main] (mg_25_1.hsq:9)
Keyword [void] (mg_25_1.hsq:9)
Param-type-list (mg_25_1.hsq:9)
Block (mg_25_1.hsq:10)
Keyword-statement [if] (mg_25_1.hsq:11)
Logical-Or [||] (mg_25_1.hsq:11)
Equality [!=] (mg_25_1.hsq:11)
Variable [a] (mg_25_1.hsq:11) =:1
Const [0] (mg_25_1.hsq:11)
Equality [==] (mg_25_1.hsq:11)
Variable [b] (mg_25_1.hsq:11) =:1
Const [2] (mg_25_1.hsq:11)
OperatorIO [__out] (mg_25_1.hsq:11)
Const [50] (mg_25_1.hsq:11)
Keyword-statement [if] (mg_25_1.hsq:12)
Logical-Or [||] (mg_25_1.hsq:12)
Equality [==] (mg_25_1.hsq:12)
Variable [a] (mg_25_1.hsq:12) =:1
Const [1] (mg_25_1.hsq:12)
Equality [!=] (mg_25_1.hsq:12)
Variable [b] (mg_25_1.hsq:12) =:1
Const [0] (mg_25_1.hsq:12)
OperatorIO [__out] (mg_25_1.hsq:12)
Const [51] (mg_25_1.hsq:12)
Logical-Or [||] (mg_25_1.hsq:14)
Equality [!=] (mg_25_1.hsq:14)
Postfix [(] (mg_25_1.hsq:14)
Label [f] (mg_25_1.hsq:14) f:3
Expression-list (mg_25_1.hsq:14)
Const [52] (mg_25_1.hsq:14)
Const [0] (mg_25_1.hsq:14)
Equality [!=] (mg_25_1.hsq:14)
Postfix [(] (mg_25_1.hsq:14)
Label [f] (mg_25_1.hsq:14) f:3
Expression-list (mg_25_1.hsq:14)
Const [53] (mg_25_1.hsq:14)
Const [0] (mg_25_1.hsq:14)
|