run.c
来自「简单的虚拟机」· C语言 代码 · 共 29 行
C
29 行
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include "run.h"#include "decode.h"void run(){ int tick=0; hlt=false; /* decode.h */ /* enable interrupt */ cpu.flags |= FLAG_I; while(!hlt) { hlt = decode(); tick++; } printf("\n==================================================\n"); printf("run(): return value: al=%d\n",*greg8_addr(0)); printf("run(): cpu ticks %d times!\n",tick);}void shutDown(){ if(cpu.ram) free(cpu.ram);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?