1234567891011121314151617181920212223242526272829303132333435363738 |
- #include <stdlib.h>
- #include <stdio.h>
- #include "vm.h"
- scm vm_code[VM_CODE_SIZE] = { 0 };
- int vm_code_size = 0;
- scm stack[STACKSIZE] = { 0 };
- scm reg_acc = 0;
- scm *reg_env = NULL;
- scm reg_clo = 0;
- scm reg_rbp = 0;
- scm reg_rbp_tmp = 0;
- scm reg_rsp = 0;
- void vm_add_codeword(scm w)
- {
- vm_code[vm_code_size++] = w;
- if(vm_code_size >= VM_CODE_SIZE) {
- fprintf(stderr, "VM_CODE_SIZE\n");
- exit(-1);
- }
- }
- void vm_dump_code()
- {
- for(int i = 0; i < vm_code_size; i++) {
- printf("%p %lu\n", vm_code+i, vm_code[i]);
- }
- }
|