mirror of https://github.com/contiki-ng/mspsim
fixed bug in BIT instruction
git-svn-id: https://mspsim.svn.sourceforge.net/svnroot/mspsim/mspsim@10 23d1a52b-0c3c-0410-b72d-8f29ab48fe35
This commit is contained in:
parent
21bde8f63c
commit
bf4adb2c16
|
|
@ -862,11 +862,12 @@ public class MSP430Core implements MSP430Constants {
|
|||
case BIT: // BIT
|
||||
dst = src & dst;
|
||||
sr = readRegister(SR);
|
||||
// Clear overflow and carry!
|
||||
sr = sr & ~(CARRY | OVERFLOW);
|
||||
// Set carry if result is non-zero!
|
||||
if (dst != 0) {
|
||||
sr |= CARRY;
|
||||
}
|
||||
// Clear overflow!
|
||||
sr &= ~OVERFLOW;
|
||||
writeRegister(SR, sr);
|
||||
break;
|
||||
case BIC: // BIC
|
||||
|
|
|
|||
|
|
@ -169,24 +169,16 @@ static void testFunctions() {
|
|||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
static void testModulo() {
|
||||
int c,i;
|
||||
c = 1;
|
||||
int c;
|
||||
testCase("Modulo");
|
||||
do {
|
||||
i = 13;
|
||||
|
||||
i = i % 14;
|
||||
/* printf("(%d,%d,%d)\n",i, (i % 14), i==1); */
|
||||
/* printf("(%d,%d,%d)\n",i, (i % 14), i==1); */
|
||||
if (i < 0) printf("%d\n",i);
|
||||
|
||||
|
||||
c = c + 1;
|
||||
} while (c < 3);
|
||||
|
||||
/* if((i % 5) == 0) { */
|
||||
/* assertTrue(i != 1); */
|
||||
/* } */
|
||||
for(c = 2; c >= 0; c--) {
|
||||
if((c % 5) == 0) {
|
||||
assertTrue(c != 1);
|
||||
}
|
||||
printf("(%d,%d,%d)\n", c, (c % 5), c==1);
|
||||
printf("(%d,%d,%d)\n", c, (c % 5), c==1);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue