Рассказываю как я проверил работу https://github.com/Ahineya/braintease/tree/main
Для проверки я поставил Rust (да да да)
Скопилял так:
$ cargo build
$ cd ./src/ripple-asm/
$ cargo build
$ cd ../../src/bf-macro-expander/
$ cargo build
$ cd ../../src/rust-bf/
$ cargo build
Далее взял пример hello.c:
void putchar(int c) {
// Use inline assembly to store character to output port
// R3 should contain the character value (first parameter)
// STORE R3, R0, R0 outputs the character
__asm__("STORE A0, R0, R0");
}
int main(int argc, char *argv[])
{
putchar(72); // H
putchar(101); // e
putchar(108); // l
putchar(108); // l
putchar(111); // o
putchar(10); // \n
return 0;
}
Далее скомпилял по инструкции:
В итоге все запустилось.✅
$ ./target/debug/rcc compile hello.c -I ./runtime/include -o hello.asm
$ ./rasm assemble ./hello.asm -o ./hello.pobj --bank-size 4096 --max-immediate 65535
$ ./src/ripple-asm/target/debug/rlink hello.pobj -f macro --standalone -o hello.bf
$ ./src/bf-macro-expander/target/debug/bfm expand ./hello.bf > hello.bf.txt
$ cat hello.bf.txt | ./src/rust-bf/target/debug/bf