diff --git a/nja b/nja index ffb2771..c831120 100755 Binary files a/nja and b/nja differ diff --git a/njvm.c b/njvm.c index f642d31..6b800ed 100644 --- a/njvm.c +++ b/njvm.c @@ -140,7 +140,7 @@ void execute(struct program *program, struct sda *sda) { currentFrame->bp = NULL; break; case PUSHL: - if (debug == 1) printf("PUSHL %d\n", SIGN_EXTEND(IMMEDIATE(instruction))); + printf("PUSHL %d\n", SIGN_EXTEND(IMMEDIATE(instruction))); currentFrame = stack.frames[stack.currentFrame]; currentFrame->bp = currentFrame->sp; int x = SIGN_EXTEND(IMMEDIATE(instruction)); diff --git a/programs/prog1.bin b/programs/prog1.bin index 1a5552c..6f89740 100644 Binary files a/programs/prog1.bin and b/programs/prog1.bin differ diff --git a/programs/prog2.bin b/programs/prog2.bin index a6de7a6..be8398d 100644 Binary files a/programs/prog2.bin and b/programs/prog2.bin differ diff --git a/programs/prog3.bin b/programs/prog3.bin index da8f524..874da1f 100644 Binary files a/programs/prog3.bin and b/programs/prog3.bin differ diff --git a/programs/prog4.bin b/programs/prog4.bin index 36d2c44..a46397e 100644 Binary files a/programs/prog4.bin and b/programs/prog4.bin differ diff --git a/programs/prog6.bin b/programs/prog6.bin index d7abab7..fe3f268 100644 Binary files a/programs/prog6.bin and b/programs/prog6.bin differ diff --git a/programs/prog7.asm b/programs/prog7.asm new file mode 100644 index 0000000..2f579d2 --- /dev/null +++ b/programs/prog7.asm @@ -0,0 +1,28 @@ +// +// prog02.asm -- call/ret with args, but without ret value +// + + asf 3 + pushc 11 + pushc 33 + call proc + drop 2 + rsf + halt + +proc: + asf 2 + pushl 4 + wrint + pushc '\n' + wrchr + pushc 22 + wrint + pushc '\n' + wrchr + pushl 3 + wrint + pushc '\n' + wrchr + rsf + ret diff --git a/programs/prog7.bin b/programs/prog7.bin new file mode 100644 index 0000000..da06984 Binary files /dev/null and b/programs/prog7.bin differ