retroforth/ffi-testing/test.c
crc c478882b7f ffi is working now
FossilOrigin-Name: b05ebe6fe6f6c78682289eda20878891671974598be6027e25a1a10a6420edfe
2022-02-15 14:40:15 +00:00

14 lines
344 B
C

#include "retroforth.h"
CELL stack_pop(NgaState *vm) {
vm->cpu[vm->active].sp--;
return vm->cpu[vm->active].data[vm->cpu[vm->active].sp + 1];
}
void stack_push(NgaState *vm, CELL value) {
vm->cpu[vm->active].sp++;
vm->cpu[vm->active].data[vm->cpu[vm->active].sp] = value;
}
void fortytwo(NgaState *retro) {
stack_push(retro, 42);
}