This commit is contained in:
Nils Polek 2023-12-09 17:48:51 +01:00
parent de248a5943
commit f5cab7c013
9 changed files with 29 additions and 1 deletions

BIN
nja

Binary file not shown.

2
njvm.c
View File

@ -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));

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

28
programs/prog7.asm Normal file
View File

@ -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

BIN
programs/prog7.bin Normal file

Binary file not shown.