//2d0 3b0 => FF F7 8E EF
//10d4 1284 00ffff92
unsigned int BLX_machine_code_make( unsigned int dstAddr, unsigned int srcAddr )
{
unsigned int offset,high,low,machineCode;
offset = dstAddr - srcAddr;
offset = (offset-4) & 0x007fffff;
high = offset >> 12;
low = (offset & 0x00000fff) >> 1;
if( low%2 != 0x00){
low++;
}
machineCode = ((0xef00 | low)<<16) | (0xf000 |high);
return machineCode;
}
unsigned int BL_machine_code_make( unsigned int dstAddr, unsigned int srcAddr )
{
unsigned int offset, machineCode;
machineCode = 0xEB000000; //jump op code
offset = dstAddr - (srcAddr+8);
//printf("offset1 = %x\n", offset);
offset = offset>>2; //jump offset instruction counts
//printf("offset2 = %x\n", offset);
offset = offset & 0x00ffffff;
machineCode = machineCode | offset;
return machineCode;
}