URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 148 |
Rev 158 |
#include "debug.h"
|
#include "debug.h"
|
|
|
char hextab[] = "0123456789abcdef";
|
char hextab[] = "0123456789abcdef";
|
|
|
int
|
int
|
foo(arg)
|
foo(arg)
|
int arg;
|
int arg;
|
{
|
{
|
return arg+1;
|
return arg+1;
|
}
|
}
|
|
|
int
|
int
|
fact (i)
|
fact (i)
|
int i;
|
int i;
|
{
|
{
|
if (i == 1)
|
if (i == 1)
|
return 1;
|
return 1;
|
else
|
else
|
return i * fact ( i - 1);
|
return i * fact ( i - 1);
|
}
|
}
|
|
|
main()
|
main()
|
{
|
{
|
unsigned char c;
|
unsigned char c;
|
int num;
|
int num;
|
char foo[100];
|
char foo[100];
|
|
|
#if 0
|
#if 0
|
set_debug_level(2);
|
set_debug_level(2);
|
|
|
cache_on();
|
cache_on();
|
#endif
|
#endif
|
|
|
set_debug_traps();
|
set_debug_traps();
|
breakpoint();
|
breakpoint();
|
|
|
print("Got to here\r\n");
|
print("Got to here\r\n");
|
|
|
while (1) {
|
while (1) {
|
c = inbyte();
|
c = inbyte();
|
if (c == 'c')
|
if (c == 'c')
|
break;
|
break;
|
|
|
if (c == 'd') {
|
if (c == 'd') {
|
set_debug_traps();
|
set_debug_traps();
|
breakpoint();
|
breakpoint();
|
break;
|
break;
|
}
|
}
|
|
|
print("echo ");
|
print("echo ");
|
outbyte(c);
|
outbyte(c);
|
print("\r\n");
|
print("\r\n");
|
}
|
}
|
|
|
print("Hello world\r\n");
|
print("Hello world\r\n");
|
|
|
while (1) {
|
while (1) {
|
c = inbyte();
|
c = inbyte();
|
|
|
if ((c & 0x7f) == 4)
|
if ((c & 0x7f) == 4)
|
break;
|
break;
|
|
|
print("Char is ");
|
print("Char is ");
|
outbyte (c);
|
outbyte (c);
|
print("\r\n");
|
print("\r\n");
|
}
|
}
|
|
|
print("I escaped!\r\n");
|
print("I escaped!\r\n");
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.