Newer
Older
emul / emul.c
@takayun takayun on 24 May 2016 496 bytes add option
#include "emul_inst_exec.h"
#include "emul_io_std.h"
#include "emul_opt.h"
#include <stdio.h>
#include <unistd.h>

void event_fa(char *arg) {
    emul_inst_exec_load(arg);
    emul_reg_init();
    emul_inst_exec_run();
}

int main(int argc, char *argv[]) {
    char c;
    emul_opt_event_fa(event_fa);
    if ( emul_opt(argc, argv) == 0 ) {
        printf("interrupt start? Y/n :");
        c = fgetc(stdin);
        if ( c == 'n' || c == 'N' ) return 0;
        else { printf("ok\n"); }
    }
}