Implemented all opcodes, including LOADI and STOREI
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
#include "stack.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
t_stack stack_new(const int size) {
|
||||
t_stack stack;
|
||||
void stack_init(t_stack& stack, const int size) {
|
||||
if (stack.data != nullptr) free(stack.data);
|
||||
stack.data = (unsigned char*)malloc(size);
|
||||
stack.max = size;
|
||||
stack.top = -1;
|
||||
stack.data = (unsigned char*)malloc(size);
|
||||
return stack;
|
||||
}
|
||||
|
||||
const bool stack_isempty(t_stack& stack) {
|
||||
|
||||
Reference in New Issue
Block a user