diff options
Diffstat (limited to 'c/bfhello/bfhello.c')
| -rw-r--r-- | c/bfhello/bfhello.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/c/bfhello/bfhello.c b/c/bfhello/bfhello.c new file mode 100644 index 0000000..95d2209 --- /dev/null +++ b/c/bfhello/bfhello.c @@ -0,0 +1,91 @@ +/* This is a translation of bfhello.b, generated by bftoc.py (by Paul Kaefer) + * It was generated on Sunday, May 17, 2026 at 12:17AM + */ + +#include "rvcontroller-ecalls.h" + +void main(void) +{ + int size = 1000; + int tape[size]; + int i = 0; + + /* Clearing the tape (array) */ + for (i=0; i<size; i++) + tape[i] = 0; + + int ptr = 0; + + tape[ptr] += 8; + while (tape[ptr] != 0) + { + ptr += 1; + tape[ptr] += 9; + ptr -= 1; + tape[ptr] -= 1; + } + ptr += 1; + printchar(tape[ptr]); + tape[ptr] += 29; + printchar(tape[ptr]); + tape[ptr] += 7; + printchar(tape[ptr]); + printchar(tape[ptr]); + tape[ptr] += 3; + printchar(tape[ptr]); + ptr += 1; + tape[ptr] += 4; + while (tape[ptr] != 0) + { + ptr += 1; + tape[ptr] += 8; + ptr -= 1; + tape[ptr] -= 1; + } + ptr += 1; + printchar(tape[ptr]); + ptr += 1; + tape[ptr] += 5; + while (tape[ptr] != 0) + { + ptr -= 1; + tape[ptr] += 11; + ptr += 1; + tape[ptr] -= 1; + } + ptr -= 1; + printchar(tape[ptr]); + ptr += 1; + tape[ptr] += 4; + while (tape[ptr] != 0) + { + ptr -= 1; + tape[ptr] += 6; + ptr += 1; + tape[ptr] -= 1; + } + ptr -= 1; + printchar(tape[ptr]); + tape[ptr] += 3; + printchar(tape[ptr]); + tape[ptr] -= 6; + printchar(tape[ptr]); + tape[ptr] -= 8; + printchar(tape[ptr]); + ptr += 1; + tape[ptr] += 3; + while (tape[ptr] != 0) + { + ptr += 1; + tape[ptr] += 11; + ptr -= 1; + tape[ptr] -= 1; + } + ptr += 1; + printchar(tape[ptr]); + ptr += 1; + tape[ptr] += 10; + printchar(tape[ptr]); + return; +} + |
