////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __BEECC__
#define __gpr
#endif
struct SSS {
signed int a,b,c,d,e, *chp;
} s;
__gpr int a;
int b[4];
long l;
#define BE __bigendian
#define LE __littlendian
void bltest( LE int * BE * LE ll, LE int * BE lb, BE int * LE bl, BE
int * BE bb )
{
**ll = 0x102;
*lb = 0x102;
*bl = 0x102;
*bb = 0x102;
}
int *iipp;
int test( struct SSS *sss, long *lp )
{
iipp[a] = 0x102;
b[a] = ++a+b[2];
sss->c = *lp;
a = b[2];
b[2] = b[1] + b[0];
*lp = 0x01020304;
*sss->chp = s.b;
a = b[a];
switch( s.a ^ s.b | test() & test() ) {
case 0:
a = 10;
s.a = *s.chp + b[3];
break;
case 1:
a = 20;
break;
case 2 :
a = 30;
break;
case 3:
a = 40;
b[2] = 0;
break;
}
return 0;
}
int main( void )
{
return test( (struct SSS *)0, &l );
}
///////////////////////////////////////////////////////////////////////////////////////////////
Test.a
//////////////////////////////////////////////////////////////////////////////////////////////
;****************************************
;*** (C) BEE SX/IP C Compiler
;*** Version 0.90.10419 beta
;*** Target : IP2022
;*** Input : TEST.C
;*** Output : TEST.A
;*** Apr 19 21:56:24 2001
;****************************************
.cpu IP2022
.section @progbits
_bltest :
.global _bltest
; **ll = 0x102;
push 1(sp)
push 3(sp)
pop IPH
pop IPL
push (ip)
inc IPL
push (ip)
pop IPL
pop IPH
mov w,#2
mov (ip),w
inc IPL
mov w,#1
mov (ip),w
; *lb = 0x102;
push 4(sp)
push 4(sp)
pop IPH
pop IPL
mov w,#2
mov (ip),w
inc IPL
mov w,#1
mov (ip),w
; *bl = 0x102;
push 5(sp)
push 7(sp)
pop IPH
pop IPL
mov (ip),w
inc IPL
mov w,#2
mov (ip),w
; *bb = 0x102;
push 8(sp)
push 8(sp)
pop IPH
pop IPL
mov w,#1
mov (ip),w
inc IPL
mov w,#2
mov (ip),w
mov w,#8
add SPL,w
ret
; commands removed 1
.section @progbits
_test :
.global _test
mov w,#6
sub SPL,w
; iipp[a] = 0x102;
mov w,_iipp+1-_D_(dp)
mov IPH,w
mov w,_a+1
add IPH,w
add IPH,w
mov w,#_iipp-_D_(dp)
mov IPL,w
mov w,_a
add IPL,w
add IPL,w
mov w,#2
mov (ip),w
inc IPL
mov w,#1
mov (ip),w
; b[a] = ++a+b[2];
incsnz _a
inc _a+1
mov w,_b+4-_D_(dp)
add w,_a
mov 5(sp),w
mov w,_b+5-_D_(dp)
addc w,_a+1
mov 6(sp),w
mov w,#((_b)/256)
mov IPH,w
mov w,_a+1
add IPH,w
add IPH,w
mov w,#((_b)&255)
mov IPL,w
mov w,_a
add IPL,w
add IPL,w
mov w,5(sp)
mov (ip),w
inc IPL
mov w,6(sp)
mov (ip),w
; sss->c = *lp;
push 9(sp)
push 11(sp)
pop IPH
pop IPL
mov w,(ip)
mov 5(sp),w
inc IPL
mov w,(ip)
mov 6(sp),w
push 7(sp)
push 9(sp)
pop IPH
pop IPL
mov w,#4
add IPL,w
mov w,5(sp)
mov (ip),w
inc IPL
mov w,6(sp)
mov (ip),w
; a = b[2];
mov w,_b+4-_D_(dp)
mov _a,w
mov w,_b+5-_D_(dp)
mov _a+1,w
; b[2] = b[1] + b[0];
mov w,_b-_D_(dp)
add w,_b+2-_D_(dp)
mov _b+4-_D_(dp),w
mov w,_b+1-_D_(dp)
addc w,_b+3-_D_(dp)
mov _b+5-_D_(dp),w
; *lp = 0x01020304;
push 9(sp)
push 11(sp)
pop IPH
pop IPL
mov w,#4
mov (ip),w
inc IPL
mov w,#3
mov (ip),w
clr (ip)
inc IPL
clr (ip)
; *sss->chp = s.b;
push 7(sp)
push 9(sp)
pop IPH
pop IPL
mov w,#10
add IPL,w
push (ip)
inc IPL
push (ip)
pop IPH
pop IPL
mov w,_s+2-_D_(dp)
mov (ip),w
inc IPL
mov w,_s+3-_D_(dp)
mov (ip),w
; a = b[a];
mov w,#((_b)/256)
mov IPH,w
mov w,_a+1
add IPH,w
add IPH,w
mov w,#((_b)&255)
mov IPL,w
mov w,_a
add IPL,w
add IPL,w
mov w,(ip)
mov _a,w
inc IPL
mov w,(ip)
mov _a+1,w
; switch( s.a ^ s.b | test() & test() ) {
mov w,_s+2-_D_(dp)
xor w,_s-_D_(dp)
mov 5(sp),w
mov w,_s+3-_D_(dp)
xor w,_s+1-_D_(dp)
mov 6(sp),w
call _test
mov w,RR
mov 3(sp),w
mov w,RR+1
mov 4(sp),w
call _test
mov w,RR
and 3(sp),w
mov w,RR+1
and 4(sp),w
mov w,3(sp)
or 5(sp),w
mov w,4(sp)
or 6(sp),w
mov w,2(sp)
cse w,#0
jmp L15
mov w,1(sp)
csne w,#0
jmp L11
csne w,#1
jmp L12
csne w,#2
jmp L13
csne w,#3
jmp L14
L15 :
jmp L10
; case 0:
L11 :
; a = 10;
mov w,#10
mov _a,w
clr _a+1
; s.a = *s.chp + b[3];
push _s+10-_D_(dp)
push _s+11-_D_(dp)
pop IPH
pop IPL
mov w,(ip)
mov 3(sp),w
inc IPL
mov w,(ip)
mov 4(sp),w
mov w,_b+6-_D_(dp)
add w,3(sp)
mov _s-_D_(dp),w
mov w,_b+7-_D_(dp)
addc w,4(sp)
mov _s+1-_D_(dp),w
jmp L9
; case 1:
L12 :
; a = 20;
mov w,#20
mov _a,w
clr _a+1
jmp L9
; case 2 :
L13 :
; a = 30;
mov w,#30
mov _a,w
clr _a+1
jmp L9
; case 3:
L14 :
; a = 40;
mov w,#40
mov _a,w
clr _a+1
; b[2] = 0;
clr _b+4-_D_(dp)
clr _b+5-_D_(dp)
jmp L9
L10 :
L9 :
; return 0;
clr RR
clr RR+1
mov w,#10
add SPL,w
ret
; commands removed 0
.section @progbits
_main :
.global _main
loadh _D_
loadl _D_
; return test( (struct SSS *)0, &l );
push #(((_l)>>8)&255)
push #((_l)&255)
push #0
push #0
call _test
ret
; commands removed 0
.gpr
.global _a
_a .space 2,0
.data
_D_ .equ $
.global _s
_s .space 12,0
.global _b
_b .space 8,0
.global _l
_l .space 4,0
.global _iipp
_iipp .space 2,0
.end
;Code size = 235