Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<reg[3] for special meaning.> <I new a project using IAR, and debug it with the IAR simulator. I modified the instruction byte code, and get strange assembles that are not documented. I draw a conclusion in my opinion, for the following instructions: [0 0 0 0 src 1 1 0 0 dst — MOVA Rsrc,Rdst], [0 0 0 0 src 1 1 0 1 dst — CMPA Rsrc,Rdst], [0 0 0 0 src 1 1 1 0 dst — ADDA Rsrc,Rdst], [0 0 0 0 src 1 1 1 1 dst — SUBA Rsrc,Rdst], when src is reg[3], it has special meanings. According to the oper, the Rsrc is MOVA: 0. CMPA: 0. ADDA: 2. SUBA: 2.> #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
13 changes: 12 additions & 1 deletion drivers/sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,18 @@ static int step_0xxx_addr(struct sim_device *dev, uint16_t ins)
switch (info->src_amode) {

case MSP430_AMODE_REGISTER:
src_data = dev->regs[src];
if((ins&0xffc0)==0x03c0)
{
switch(ins&0x0030)
{
case 0x00:src_data=0;break;
case 0x10:src_data=0;break;
case 0x20:src_data=2;break;
case 0x30:src_data=2;break;
}
}
else
src_data = dev->regs[src];
break;

case MSP430_AMODE_IMMEDIATE:
Expand Down