diff --git a/CMakeLists.txt b/CMakeLists.txt index f1186eb..a010125 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,18 @@ set(CMAKE_C_STANDARD 99) add_compile_options(-g -Wall -pedantic) -include_directories("./bigint/build/include") +add_executable(njvm njvm.c) + +# Include directories for njvm executable +target_include_directories(njvm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bigint/build/include) + +# Add the library +add_library(bigint STATIC ${CMAKE_SOURCE_DIR}/bigint/src/bigint.c + support.c) + +# Include directories for the bigint library +target_include_directories(bigint PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bigint/build/include) + +# Link the executable with the library +target_link_libraries(njvm PRIVATE bigint) -add_executable(ninja njvm.c - SDA.c) diff --git a/njvm.c b/njvm.c index 04168b7..2069520 100644 --- a/njvm.c +++ b/njvm.c @@ -43,6 +43,7 @@ void execute(struct program program) { ObjRef tempObj2; int tempInt; for (i = 0; i < *program.size; ++i) { + printf("Program ist an der stelle %i\n", i); if (debug == 1) debugMenu(fp, stack, &debug, i); switch (program.program[i] >> 24) { case HALT: @@ -276,6 +277,7 @@ void execute(struct program program) { tempObj = pop(stack).u.objRef; tempObj2 = pop(stack).u.objRef; bip.op1 = pop(stack).u.objRef; + bigPrint(stdout); tempInt = bigToInt(); setField(tempObj2, tempInt,tempObj); break; diff --git a/njvm.o b/njvm.o index 7e95bbc..91dedc9 100644 Binary files a/njvm.o and b/njvm.o differ