Repository files navigation
Linux:
Change the .dll to .so in the import statements
./jvavc malloc.jvav
./jvav malloc
Windows Powershell:
Change the .so to .dll in the import statements
./jvavc malloc.jvav
./jvav malloc
INST_PUSH
push
push a i64/u64/f64 to the stack, effectively increase stack size by one.
INST_POP
pop
remove specified amount of variable from the stack starting from the top of the stack.
INST_DUP
dup
duplicate the variable relative to the top of the stack to the stack top, effectively increase stack size by one.
INST_SWAP
swap
swap the current top of the stack to the variable relative to the top of the stack, does not change stack size.
INST_ADD_I
addi
add the top of the stack to the second top of the stack as integers, effectively decrease stack size by one.
INST_SUB_I
subi
subtract the top of the stack from the second top of the stack as integers, effectively decrease stack size by one.
INST_MUL_I
muli
multiply the top of the stack to the second top of the stack as integers, effectively decrease stack size by one.
INST_DIV_I
divi
divide the top of the stack from the second top of the stack as integers, effectively decrease stack size by one.
INST_MOD_I
modi
modulo the top of the stack from the second top of the stack as integers, effectively decrease stack size by one.
INST_ADD_U
INST_SUB_U
INST_MUL_U
INST_DIV_U
INST_ADD_F
INST_SUB_F
INST_MUL_F
INST_DIV_F
INST_CMP_I
INST_CMP_U
INST_CMP_F
INST_AND
INST_OR
INST_NOT
INST_I_TO_U
INST_I_TO_F
INST_U_TO_I
INST_U_TO_F
INST_F_TO_I
INST_F_TO_U
INST_JMP
INST_JMP_E
INST_JMP_NE
INST_JMP_G
INST_JMP_L
INST_JMP_GE
INST_JMP_LE
INST_NATIVE
native
For FFI calls, build dynamically library linking to ljvm.
You should build wrapper function for the vm to work properly, function prototype should be trap_type foo( vm_t* vm );.
You should use trap_type vm_stack_push( vm_t* vm, word_t word ); to push data onto the vm.
And trap_type vm_stack_pop( vm_t* vm, word_t* word ); to pop data from the vm.
You can’t perform that action at this time.