#include #include "emu.h" #include "util.h" int main() { Emulator* emu = initEmulator(0x00010FFF); if (!emu) { fprintf(stderr, "emu: error: failed to allocate memory for emulator\n"); return 1; } Instruction program[] = { {INST_MVI, {REG_A}, 0, true}, {INST_MVI, {REG_B}, 123, true}, {INST_PORT, {REG_A, REG_B, 0}, 0, false}, {INST_PORT, {REG_A, REG_B, 1}, 0, false}, {INST_HLT, {}, 0, false} }; memoryLoadProgram(emu->mem, program, sizeof(program)/sizeof(program[0])); startEmulator(emu); freeEmulator(emu); return 0; }