Testing
This commit is contained in:
parent
de248a5943
commit
f5cab7c013
2
njvm.c
2
njvm.c
@ -140,7 +140,7 @@ void execute(struct program *program, struct sda *sda) {
|
|||||||
currentFrame->bp = NULL;
|
currentFrame->bp = NULL;
|
||||||
break;
|
break;
|
||||||
case PUSHL:
|
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 = stack.frames[stack.currentFrame];
|
||||||
currentFrame->bp = currentFrame->sp;
|
currentFrame->bp = currentFrame->sp;
|
||||||
int x = SIGN_EXTEND(IMMEDIATE(instruction));
|
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
28
programs/prog7.asm
Normal 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
BIN
programs/prog7.bin
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user