Data Transfer Instructions detection

This commit is contained in:
IniKiwi 2021-10-26 11:29:08 +02:00
parent b93983bd4a
commit f6ad9a904b
1 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,135 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "instructions.h"
int GetInstruction(shcommand_t command){
//Data Transfer Instructions
if(command.n1 == 0x6 && command.n4 == 0x3){
return MOV_R_R;
}
else if(command.n1 == 0xE){
return MOV_B_R;
}
else if(command.b1 == 0xC7){
return MOVA_PC_R0;
}
else if(command.n1 == 0x9){
return MOVW_PC_R;
}
else if(command.n1 == 0xD){
return MOVL_PC_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x0){
return MOVB_aR_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x1){
return MOVW_aR_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x2){
return MOVL_aR_R;
}
else if(command.n1 == 0x2 && command.n4 == 0x0){
return MOVB_R_aR;
}
else if(command.n1 == 0x2 && command.n4 == 0x1){
return MOVW_R_aR;
}
else if(command.n1 == 0x2 && command.n4 == 0x2){
return MOVL_R_aR;
}
else if(command.n1 == 0x6 && command.n4 == 0x4){
return MOVB_aRp_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x5){
return MOVW_aRp_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x6){
return MOVL_aRp_R;
}
else if(command.n1 == 0x2 && command.n4 == 0x4){
return MOVB_R_amR;
}
else if(command.n1 == 0x2 && command.n4 == 0x5){
return MOVW_R_amR;
}
else if(command.n1 == 0x2 && command.n4 == 0x6){
return MOVL_R_amR;
}
else if(command.b1 == 0x84){
return MOVB_PCR_R0;
}
else if(command.b1 == 0x84){
return MOVW_PCR_R0;
}
else if(command.n1 == 0x5){
return MOVL_PCR_R;
}
else if(command.b1 == 0x81){
return MOVW_R0_PCR;
}
else if(command.n1 == 0x1){
return MOVL_R_PCR;
}
else if(command.n1 == 0x0 && command.n4 == 0xC){
return MOVB_R0R_R;
}
else if(command.n1 == 0x0 && command.n4 == 0xD){
return MOVW_R0R_R;
}
else if(command.n1 == 0x0 && command.n4 == 0xE){
return MOVL_R0R_R;
}
else if(command.n1 == 0x0 && command.n4 == 0x4){
return MOVB_R_R0R;
}
else if(command.n1 == 0x0 && command.n4 == 0x5){
return MOVW_R_R0R;
}
else if(command.n1 == 0x0 && command.n4 == 0x6){
return MOVL_R_R0R;
}
else if(command.b1 == 0xC4){
return MOVB_PCGBR_R0;
}
else if(command.b1 == 0xC5){
return MOVW_PCGBR_R0;
}
else if(command.b1 == 0xC6){
return MOVL_PCGBR_R0;
}
else if(command.b1 == 0xC0){
return MOVB_R0_PCGBR;
}
else if(command.b1 == 0xC1){
return MOVW_R0_PCGBR;
}
else if(command.b1 == 0xC2){
return MOVL_R0_PCGBR;
}
else if(command.n1 == 0x0 && command.b2 == 0x73){
return MOVCOL_R0_aR;
}
else if(command.n1 == 0x0 && command.b2 == 0x63){
return MOVLIL_aR_R0;
}
else if(command.n1 == 0x4 && command.b2 == 0xA9){
return MOVUAL_aR_R0;
}
else if(command.n1 == 0x4 && command.b2 == 0xE9){
return MOVUAL_aRp_R0;
}
else if(command.n1 == 0x0 && command.b2 == 0x29){
return MOVT_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x8){
return SWAPB_R_R;
}
else if(command.n1 == 0x6 && command.n4 == 0x9){
return SWAPW_R_R;
}
else if(command.n1 == 0x2 && command.n4 == 0xD){
return XTRCT_R_R;
}
}