URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
short optab[5];
|
short optab[5];
|
char buf[10];
|
char buf[10];
|
execute (ip)
|
execute (ip)
|
register short *ip;
|
register short *ip;
|
{
|
{
|
#ifndef NO_LABEL_VALUES
|
#ifndef NO_LABEL_VALUES
|
register void *base = &&x;
|
register void *base = &&x;
|
char *bp = buf;
|
char *bp = buf;
|
static void *tab[] = {&&x, &&y, &&z};
|
static void *tab[] = {&&x, &&y, &&z};
|
if (ip == 0)
|
if (ip == 0)
|
{
|
{
|
int i;
|
int i;
|
for (i = 0; i < 3; ++i)
|
for (i = 0; i < 3; ++i)
|
optab[i] = (short)(tab[i] - base);
|
optab[i] = (short)(tab[i] - base);
|
return;
|
return;
|
}
|
}
|
x: *bp++='x';
|
x: *bp++='x';
|
goto *(base + *ip++);
|
goto *(base + *ip++);
|
y: *bp++='y';
|
y: *bp++='y';
|
goto *(base + *ip++);
|
goto *(base + *ip++);
|
z: *bp++='z';
|
z: *bp++='z';
|
*bp=0;
|
*bp=0;
|
return;
|
return;
|
#else
|
#else
|
strcpy (buf, "xyxyz");
|
strcpy (buf, "xyxyz");
|
#endif
|
#endif
|
}
|
}
|
|
|
short p[5];
|
short p[5];
|
|
|
main ()
|
main ()
|
{
|
{
|
execute ((short *) 0);
|
execute ((short *) 0);
|
p[0] = optab[1];
|
p[0] = optab[1];
|
p[1] = optab[0];
|
p[1] = optab[0];
|
p[2] = optab[1];
|
p[2] = optab[1];
|
p[3] = optab[2];
|
p[3] = optab[2];
|
execute (&p);
|
execute (&p);
|
if (strcmp (buf, "xyxyz"))
|
if (strcmp (buf, "xyxyz"))
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.