diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0655d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +Lex_Yacc/as.tab* +Lex_Yacc/as.dot +Lex_Yacc/as.output +Lex_Yacc/lex.yy.* +Tables/tables.o +rondoudou_cross_assembleur +Inputs/* +Outputs/* diff --git a/LexYacc/al.lex b/Lex_Yacc/al.lex similarity index 100% rename from LexYacc/al.lex rename to Lex_Yacc/al.lex diff --git a/LexYacc/as.y b/Lex_Yacc/as.y similarity index 99% rename from LexYacc/as.y rename to Lex_Yacc/as.y index 0cc9995..ed79ee1 100644 --- a/LexYacc/as.y +++ b/Lex_Yacc/as.y @@ -2,7 +2,7 @@ int nombre; } %{ -#include "tables.h" +#include "../Tables/tables.h" #include FILE * file; @@ -153,6 +153,6 @@ int main(void) { init(); yyparse(); write_asm(file); - write_code_machine_compact(file2); + write_code_machine(file2, 0); return 0; } diff --git a/Makefile b/Makefile index 0039780..83539eb 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ clean_Tables: @rm -f Tables/*.o clean_Lex_Yacc: - @rm -f Lex_Yacc/as.output Lex_Yacc/as.tab.* Lex_Yacc/lex.yy.* + @rm -f Lex_Yacc/as.output Lex_Yacc/as.tab.* Lex_Yacc/lex.yy.* Lex_Yacc/as.dot clean_Inputs: @rm -f Inputs/* diff --git a/Tables/tables.c b/Tables/tables.c index 4f3dac6..3ca50dd 100644 --- a/Tables/tables.c +++ b/Tables/tables.c @@ -383,12 +383,12 @@ void write_code_machine(FILE * file, char compact) { i--; } } else { - printf(file, "\""); + fprintf(file, "\""); int i = MEM_INST_SIZE - 1; while (i>=0) { write_instruction_binary(file, buffer[i], 1); i--; } - printf(file, "\"\n"); + fprintf(file, "\"\n"); } }