Skip to content

Commit

Permalink
Arm7 thumbsign improvements cont (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadez2003 authored Oct 23, 2020
1 parent 55ea125 commit aeb320e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/cpu/arm7/arm7dasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,20 @@ void thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode )
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "EOR R%d, R%d", rd, rs );
break;
case 0x3: /* LSR Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "LSR R%d, R%d", rd, rs );
break;
case 0x5: /* ADC Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "ADC R%d, R%d", rd, rs );
break;
case 0x7: /* ROR Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "TST R%d, R%d", rd, rs );
pBuf += sprintf( pBuf, "ROR R%d, R%d", rd, rs );
break;
case 0x8: /* TST Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
Expand All @@ -754,6 +764,11 @@ void thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode )
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "MUL R%d, R%d", rd, rs );
break;
case 0xe: /* MUL Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
pBuf += sprintf( pBuf, "BIC R%d, R%d", rd, rs );
break;
case 0xf: /* MVN Rd, Rs */
rs = ( opcode & THUMB_ADDSUB_RS ) >> THUMB_ADDSUB_RS_SHIFT;
rd = ( opcode & THUMB_ADDSUB_RD ) >> THUMB_ADDSUB_RD_SHIFT;
Expand Down Expand Up @@ -864,6 +879,12 @@ void thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode )
rd = ( opcode & THUMB_GROUP5_RD ) >> THUMB_GROUP5_RD_SHIFT;
pBuf += sprintf( pBuf, "STRB R%d, [R%d, R%d]", rd, rn, rm );
break;
case 0x3: /* LDRSB Rd, [Rn, Rm] */
rm = ( opcode & THUMB_GROUP5_RM ) >> THUMB_GROUP5_RM_SHIFT;
rn = ( opcode & THUMB_GROUP5_RN ) >> THUMB_GROUP5_RN_SHIFT;
rd = ( opcode & THUMB_GROUP5_RD ) >> THUMB_GROUP5_RD_SHIFT;
pBuf += sprintf( pBuf, "LDRSB R%d, [R%d, R%d]", rd, rn, rm );
break;
case 0x4: /* LDR Rd, [Rn, Rm] */ /* check */
rm = ( opcode & THUMB_GROUP5_RM ) >> THUMB_GROUP5_RM_SHIFT;
rn = ( opcode & THUMB_GROUP5_RN ) >> THUMB_GROUP5_RN_SHIFT;
Expand Down

0 comments on commit aeb320e

Please sign in to comment.