jserv / amacc

Small C Compiler generating ELF executable Arm architecture, supporting JIT execution
Other
1.01k stars 161 forks source link

Implement standalone interpreter for generated IR #32

Closed jserv closed 5 years ago

jserv commented 6 years ago

At present, AMaCC translates C source into internal bytecode form on which code generator depends for Arm machine code. The argument -s is to generate bytecode from parsing tree. Here is the example:

$ ./amacc -s tests/hello.c 
1: #include <stdio.h>
2: 
3: int main()
4: {
5:     printf("hello, world\n");
    ENT  0
    IMM  -568971248
    PSH 
    PRTF
    ADJ  1
6:     return 0;
    IMM  0
    LEV 
7: }

Branch interpreter provides incomplete interpreter support, which can accepts bytecode. It would be great if we can take the standalone interpreter to validate AMaCC internally.

Reference: Write a C interpreter

splasky commented 5 years ago

The branch interpreter is outdated. Maybe we can close it.

jserv commented 5 years ago

This issue is invalid per @splasky requested.