t_bool op_check_name(char *name) { int i; i = 0; while (i < 16) { if (ft_strequ(name, op_tab(i).name)) return (true); ++i; } return (false); }
t_process *process_creat(size_t index, int id, int color_id) { t_process *process; static size_t uid = 1; if ((process = (t_process *)malloc(sizeof(t_process))) == NULL) return (NULL); process->uid = uid++; process->id = id; process->pc = index; s_ini_reg(process, id); process->live = 0; process->carry = 0; process->op = op_tab(16); process->op_cycle = 0; process->in_action = false; process->color_id = color_id; return (process); }
qw_op_t qw_edit_op(qw_edit_t *e, qw_event_t *ev) { qw_op_t r = QW_OP_NOP; qw_core_t *c = ev->c; switch (ev->o) { case QW_OP_LEFT: op_left(e); break; case QW_OP_RIGHT: op_right(e); break; case QW_OP_UP: op_up(e, ev->f); break; case QW_OP_DOWN: op_down(e, ev->f); break; case QW_OP_PGUP: op_pgup(e, ev->f); break; case QW_OP_PGDN: op_pgdn(e, ev->f); break; case QW_OP_BOL: op_bol(e); break; case QW_OP_EOL: op_eol(e); break; case QW_OP_BOR: op_bor(e, ev->f); break; case QW_OP_EOR: op_eor(e, ev->f); break; case QW_OP_BOF: op_bof(e); break; case QW_OP_EOF: op_eof(e); break; case QW_OP_CHAR: op_char(e, ev->w); break; case QW_OP_DEL: op_del(e); break; case QW_OP_BACKSPACE: op_backspace(e); break; case QW_OP_NEWLINE: op_char(e, L'\n'); break; case QW_OP_TAB: op_tab(e, ev->f, c); break; case QW_OP_HARD_TAB: op_char(e, L'\t'); break; case QW_OP_DEL_ROW: op_del_row(e, ev->f); break; case QW_OP_UNDO: op_undo(e); break; case QW_OP_MARK: op_mark(e); break; case QW_OP_UNMARK: op_unmark(e); break; case QW_OP_COPY: op_copy(e, c); op_unmark(e); break; case QW_OP_PASTE: op_paste(e, c); break; case QW_OP_CUT: op_cut(e, c); break; case QW_OP_SAVE: op_save(e); break; case QW_OP_SHOW_CODES: ev->f->l = L" \xb6"[!!(ev->f->l == L' ')]; break; case QW_OP_SEARCH: op_search(e, c); break; case QW_OP_CLOSE: r = QW_OP_DESTROY; break; case QW_OP_DESTROY: r = QW_OP_DESTROY; break; case QW_OP_NOP: case QW_OP_COUNT: break; } return r; }
void m58846_device::execute_one() { // handle one opcode switch (m_op & 0x1f0) { case 0x30: op_sey(); break; case 0x70: op_sp(); break; case 0xa0: op_a(); break; case 0xb0: op_la(); break; case 0xc0: case 0xd0: case 0xe0: case 0xf0: op_lxy(); break; default: switch (m_op & 0x1fc) { case 0x20: op_szb(); break; case 0x4c: op_sb(); break; case 0x58: op_szk(); break; case 0x5c: op_rb(); break; case 0x60: op_xam(); break; case 0x64: op_tam(); break; case 0x68: op_xamd(); break; case 0x6c: op_xami(); break; default: switch (m_op) { case 0x06: case 0x07: op_su(); break; case 0x40: case 0x41: op_lcps(); break; case 0x4a: case 0x4b: op_lz(); break; case 0x54: case 0x55: op_ias(); break; case 0x00: op_nop(); break; case 0x01: op_ba(); break; case 0x02: op_iny(); break; case 0x03: op_dey(); break; case 0x04: op_di(); break; case 0x05: op_ei(); break; case 0x09: op_tabe(); break; // undocumented case 0x0a: op_am(); break; case 0x0b: op_ose(); break; case 0x0c: op_tya(); break; case 0x0f: op_cma(); break; case 0x10: op_cls(); break; case 0x11: op_clds(); break; case 0x13: op_cld(); break; case 0x14: op_rd(); break; case 0x15: op_sd(); break; case 0x16: op_tepa(); break; case 0x17: op_ospa(); break; case 0x18: op_rl(); break; // undocumented case 0x19: op_rr(); break; // undocumented case 0x1a: op_teab(); break; case 0x1b: op_osab(); break; case 0x1c: op_tba(); break; case 0x1d: op_tay(); break; case 0x1e: op_tab(); break; case 0x26: op_seam(); break; case 0x2b: op_szd(); break; case 0x2f: op_szc(); break; case 0x43: op_amc(); break; case 0x44: op_rt(); break; case 0x45: op_rts(); break; case 0x46: op_rti(); break; case 0x48: op_rc(); break; case 0x49: op_sc(); break; case 0x53: op_amcs(); break; case 0x57: op_iak(); break; case 0x81: op_ofa(); break; case 0x82: op_snz1(); break; case 0x83: op_snz2(); break; case 0x84: op_oga(); break; case 0x85: op_t2ab(); break; case 0x86: op_tva(); break; case 0x8a: op_tab2(); break; case 0x8c: op_iaf(); break; default: melps4_cpu_device::execute_one(); break; } break; // 0x1ff } break; // 0x1fc } // big switch }
void ucom4_cpu_device::execute_run() { while (m_icount > 0) { m_icount--; // remember previous opcode m_prev_op = m_op; // handle interrupt - it not accepted during LI($9x) or EI($31), or while skipping if (m_int_f && m_inte_f && (m_prev_op & 0xf0) != 0x90 && m_prev_op != 0x31 && !m_skip) { m_icount--; push_stack(); m_pc = 0xf << 2; m_int_f = 0; m_inte_f = (m_family == NEC_UCOM43) ? 0 : 1; standard_irq_callback(0); } // fetch next opcode debugger_instruction_hook(this, m_pc); m_op = m_program->read_byte(m_pc); m_bitmask = 1 << (m_op & 0x03); increment_pc(); fetch_arg(); if (m_skip) { m_skip = false; m_op = 0; // nop } // handle opcode switch (m_op & 0xf0) { case 0x80: op_ldz(); break; case 0x90: op_li(); break; case 0xa0: op_jmpcal(); break; case 0xb0: op_czp(); break; case 0xc0: case 0xd0: case 0xe0: case 0xf0: op_jcp(); break; default: switch (m_op) { case 0x00: op_nop(); break; case 0x01: op_di(); break; case 0x02: op_s(); break; case 0x03: op_tit(); break; case 0x04: op_tc(); break; case 0x05: op_ttm(); break; case 0x06: op_daa(); break; case 0x07: op_tal(); break; case 0x08: op_ad(); break; case 0x09: op_ads(); break; case 0x0a: op_das(); break; case 0x0b: op_clc(); break; case 0x0c: op_cm(); break; case 0x0d: op_inc(); break; case 0x0e: op_op(); break; case 0x0f: op_dec(); break; case 0x10: op_cma(); break; case 0x11: op_cia(); break; case 0x12: op_tla(); break; case 0x13: op_ded(); break; case 0x14: op_stm(); break; case 0x15: op_ldi(); break; case 0x16: op_cli(); break; case 0x17: op_ci(); break; case 0x18: op_exl(); break; case 0x19: op_adc(); break; case 0x1a: op_xc(); break; case 0x1b: op_stc(); break; case 0x1c: op_illegal(); break; case 0x1d: op_inm(); break; case 0x1e: op_ocd(); break; case 0x1f: op_dem(); break; case 0x30: op_rar(); break; case 0x31: op_ei(); break; case 0x32: op_ip(); break; case 0x33: op_ind(); break; case 0x40: op_ia(); break; case 0x41: op_jpa(); break; case 0x42: op_taz(); break; case 0x43: op_taw(); break; case 0x44: op_oe(); break; case 0x45: op_illegal(); break; case 0x46: op_tly(); break; case 0x47: op_thx(); break; case 0x48: op_rt(); break; case 0x49: op_rts(); break; case 0x4a: op_xaz(); break; case 0x4b: op_xaw(); break; case 0x4c: op_xls(); break; case 0x4d: op_xhr(); break; case 0x4e: op_xly(); break; case 0x4f: op_xhx(); break; default: switch (m_op & 0xfc) { case 0x20: op_fbf(); break; case 0x24: op_tab(); break; case 0x28: op_xm(); break; case 0x2c: op_xmd(); break; case 0x34: op_cmb(); break; case 0x38: op_lm(); break; case 0x3c: op_xmi(); break; case 0x50: op_tpb(); break; case 0x54: op_tpa(); break; case 0x58: op_tmb(); break; case 0x5c: op_fbt(); break; case 0x60: op_rpb(); break; case 0x64: op_reb(); break; case 0x68: op_rmb(); break; case 0x6c: op_rfb(); break; case 0x70: op_spb(); break; case 0x74: op_seb(); break; case 0x78: op_smb(); break; case 0x7c: op_sfb(); break; } break; // 0xfc } break; // 0xff } // big switch } }