kernels,bf: port to AM
This commit is contained in:
parent
b122a7fa12
commit
1cf8c67eb6
3 changed files with 219 additions and 73 deletions
3
kernels/bf/Makefile
Normal file
3
kernels/bf/Makefile
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
NAME = bf
|
||||||
|
SRCS = bf.c
|
||||||
|
include $(AM_HOME)/Makefile
|
|
@ -4,24 +4,20 @@
|
||||||
*
|
*
|
||||||
* Robert de Bath -- 2013.
|
* Robert de Bath -- 2013.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <am.h>
|
||||||
#include <stdlib.h>
|
#include <klib.h>
|
||||||
#include <string.h>
|
|
||||||
|
const char *prog =
|
||||||
|
#include "mandelbrot.h"
|
||||||
|
;
|
||||||
|
|
||||||
struct bfi { char cmd; struct bfi *next, *jmp; };
|
struct bfi { char cmd; struct bfi *next, *jmp; };
|
||||||
struct mem { char val; struct mem *next, *prev; };
|
struct mem { char val; struct mem *next, *prev; };
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main() {
|
||||||
{
|
|
||||||
FILE * ifd;
|
|
||||||
int ch;
|
int ch;
|
||||||
struct bfi *p=0, *n=0, *j=0, *pgm = 0;
|
struct bfi *p=0, *n=0, *j=0, *pgm = 0;
|
||||||
struct mem *m = calloc(1,sizeof*m);
|
struct mem *m = malloc(sizeof(*m));
|
||||||
setbuf(stdout, NULL);
|
|
||||||
|
|
||||||
/* Open the file from the command line or stdin */
|
|
||||||
if (argc < 2 || strcmp(argv[1], "-") == 0) ifd = stdin;
|
|
||||||
else if ((ifd = fopen(argv[1], "r")) == 0) { perror(argv[1]); exit(1); }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For each character, if it's a valid BF command add it onto the
|
* For each character, if it's a valid BF command add it onto the
|
||||||
|
@ -33,11 +29,13 @@ int main(int argc, char **argv)
|
||||||
* command and so is ignored. If there are any '[' commands left
|
* command and so is ignored. If there are any '[' commands left
|
||||||
* over at the end they are not valid BF commands and so are ignored.
|
* over at the end they are not valid BF commands and so are ignored.
|
||||||
*/
|
*/
|
||||||
while((ch = getc(ifd)) != EOF && (ifd!=stdin || ch != '!' || j || !pgm)) {
|
const char *s = prog;
|
||||||
|
while((ch = *(s ++)) != '\0') {
|
||||||
if (ch == '<' || ch == '>' || ch == '+' || ch == '-' ||
|
if (ch == '<' || ch == '>' || ch == '+' || ch == '-' ||
|
||||||
ch == ',' || ch == '.' || ch == '[' || (ch == ']' && j)) {
|
ch == ',' || ch == '.' || ch == '[' || (ch == ']' && j)) {
|
||||||
if ((n = calloc(1, sizeof*n)) == 0) {
|
if ((n = malloc(sizeof(*n))) == NULL) {
|
||||||
perror(argv[0]); exit(1);
|
printf("malloc failed! exiting...\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
if (p) p->next = n; else pgm = n;
|
if (p) p->next = n; else pgm = n;
|
||||||
n->cmd = ch; p = n;
|
n->cmd = ch; p = n;
|
||||||
|
@ -51,34 +49,33 @@ int main(int argc, char **argv)
|
||||||
/* Ignore any left over '[' commands */
|
/* Ignore any left over '[' commands */
|
||||||
while(j) { p = j; j = j->jmp; p->jmp = 0; p->cmd = ' '; }
|
while(j) { p = j; j = j->jmp; p->jmp = 0; p->cmd = ' '; }
|
||||||
|
|
||||||
if (ifd!=stdin) fclose(ifd);
|
|
||||||
|
|
||||||
/* Execute the loaded BF program */
|
/* Execute the loaded BF program */
|
||||||
for(n=pgm; n; n=n->next)
|
for(n=pgm; n; n=n->next) {
|
||||||
switch(n->cmd)
|
switch(n->cmd) {
|
||||||
{
|
|
||||||
case '+': m->val++; break;
|
case '+': m->val++; break;
|
||||||
case '-': m->val--; break;
|
case '-': m->val--; break;
|
||||||
case '.': putchar(m->val); break;
|
case '.': putch(m->val); break;
|
||||||
case ',': if((ch=getchar())!=EOF) m->val=ch; break;
|
case ',': if((ch=*(s ++))!='\0') m->val=ch; break;
|
||||||
case '[': if (m->val == 0) n=n->jmp; break;
|
case '[': if (m->val == 0) n=n->jmp; break;
|
||||||
case ']': if (m->val != 0) n=n->jmp; break;
|
case ']': if (m->val != 0) n=n->jmp; break;
|
||||||
case '<':
|
case '<':
|
||||||
if (!(m=m->prev)) {
|
if (!(m=m->prev)) {
|
||||||
fprintf(stderr, "%s: Hit start of tape\n", argv[0]);
|
printf("Hit start of tape\n");
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '>':
|
case '>':
|
||||||
if (m->next == 0) {
|
if (m->next == 0) {
|
||||||
if ((m->next = calloc(1,sizeof*m)) == 0) {
|
if ((m->next = malloc(sizeof(*m))) == NULL) {
|
||||||
perror(argv[0]); exit(1);
|
printf("malloc failed! exiting...\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
m->next->prev = m;
|
m->next->prev = m;
|
||||||
}
|
}
|
||||||
m=m->next;
|
m=m->next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
146
kernels/bf/mandelbrot.h
Normal file
146
kernels/bf/mandelbrot.h
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
"\
|
||||||
|
A mandelbrot set fractal viewer in brainf*** written by Erik Bosman \
|
||||||
|
+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[ \
|
||||||
|
>>>>>>>>>]+[<<<<<<<<<]>>>>>>>>>-]+[>>>>>>>>[-]>]<<<<<<<<<[<<<<<<<<<]>>>>>>>>[-]+ \
|
||||||
|
<<<<<<<+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>>>+>>>>>>>>>>>>>>>>>>>>>>>>>> \
|
||||||
|
>+<<<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+[>>>>>>[>>>>>>>[-]>>]<<<<<<<<<[<<<<<<<<<]>> \
|
||||||
|
>>>>>[-]+<<<<<<++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>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