OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [libgloss/] [sparc/] [test.c] - Blame information for rev 179

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
#include "debug.h"
2
 
3
char hextab[] = "0123456789abcdef";
4
 
5
int
6
foo(arg)
7
     int arg;
8
{
9
  return arg+1;
10
}
11
 
12
int
13
fact (i)
14
     int i;
15
{
16
  if (i == 1)
17
    return 1;
18
  else
19
    return i * fact ( i - 1);
20
}
21
 
22
main()
23
{
24
  unsigned char c;
25
  int num;
26
  char foo[100];
27
 
28
#if 0
29
  set_debug_level(2);
30
 
31
  cache_on();
32
#endif
33
 
34
  set_debug_traps();
35
  breakpoint();
36
 
37
  print("Got to here\r\n");
38
 
39
  while (1) {
40
    c = inbyte();
41
    if (c == 'c')
42
      break;
43
 
44
    if (c == 'd') {
45
      set_debug_traps();
46
      breakpoint();
47
      break;
48
    }
49
 
50
    print("echo ");
51
    outbyte(c);
52
    print("\r\n");
53
  }
54
 
55
  print("Hello world\r\n");
56
 
57
  while (1) {
58
    c = inbyte();
59
 
60
    if ((c & 0x7f) == 4)
61
      break;
62
 
63
    print("Char is ");
64
    outbyte (c);
65
    print("\r\n");
66
  }
67
 
68
  print("I escaped!\r\n");
69
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.