From 8e9d0b5e9a4613e9ef980b5c0fd8e53f2c394195 Mon Sep 17 00:00:00 2001 From: A404M Date: Tue, 8 Oct 2024 19:58:00 +0330 Subject: fixed some bugs in fasm --- src/main.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 8f9b095..fec258d 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -56,17 +57,17 @@ int compileFasm(const char *const filePath) { } pushToSourceCode(&sourceCode, code); - printf("----lexing:\n"); + // printf("----lexing:\n"); FasmLines *lines; if ((lines = fasmLexer(&sourceCode)) == NULL) { goto RETURN_ERROR; } - for (size_t i = 0; i < sourceCode.size; ++i) { - fasmLinesPrint(lines[i]); - } + // for (size_t i = 0; i < sourceCode.size; ++i) { + // fasmLinesPrint(lines[i]); + // } - printf("----linking:\n"); + // printf("----linking:\n"); FasmLinkedLines linkedLines = fasmLinker(lines, &sourceCode); @@ -74,10 +75,17 @@ int compileFasm(const char *const filePath) { goto RETURN_LINKED_ERROR; } - fasmLinkedLinesPrint(linkedLines); + // fasmLinkedLinesPrint(linkedLines); + + // printf("----bytecode:\n"); ByteCode bytecode = fasmCodeGenerator(&linkedLines); + // for (size_t i = 0; i < bytecode.code_size; ++i) { + // printf("0x%.2x ", bytecode.code[i]); + //} + // printf("\n"); + deleteByteCodeInners(bytecode); fasmLinkedLinesDeleteInner(linkedLines); -- cgit v1.2.3