static offs_t arm7_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) { if( T_IS_SET(GET_CPSR) ) { return thumb_disasm( buffer, pc, oprom[0] | (oprom[1] << 8)) | 2; } else { return arm7_disasm( buffer, pc, oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24)) | 4; } }
int darm_thumb_disasm(darm_t *d, uint16_t w) { memset(d, 0, sizeof(darm_t)); d->instr = I_INVLD; d->instr_type = T_INVLD; d->shift_type = S_INVLD; d->S = d->E = d->U = d->H = d->P = d->I = B_INVLD; d->R = d->T = d->W = d->M = d->N = d->B = B_INVLD; d->dtype = d->stype = D_INVLD; d->Rd = d->Rn = d->Rm = d->Ra = d->Rt = R_INVLD; d->Rt2 = d->RdHi = d->RdLo = d->Rs = R_INVLD; d->option = O_INVLD; switch (w >> 11) { case 0b11101: case 0b11110: case 0b11111: fprintf(stderr, "darm_thumb_disasm: unknown err\n"); return -1; default: d->w = w; return thumb_disasm(d, w); } }