Last change
on this file since 529 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
798 bytes
|
Rev | Line | |
---|
[444] | 1 | #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 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.