fixed typo in POP looking at wrong register
authorJustin Wind <justin.wind@gmail.com>
Sun, 13 May 2012 17:04:02 +0000 (10:04 -0700)
committerJustin Wind <justin.wind@gmail.com>
Sun, 13 May 2012 17:04:02 +0000 (10:04 -0700)
dcpu16.c

index ea0ee261d7c02398e8d4c26caf9a2fd5720545d1..616237de3d99d7bc2628cd405ea6f8ee65c2fad1 100644 (file)
--- a/dcpu16.c
+++ b/dcpu16.c
@@ -178,7 +178,7 @@ void value_decode_(struct dcpu16 *vm, DCPU16_WORD value, unsigned int value_is_a
     assert(value <= 0x3f);
 
     DCPU16_WORD pc = (DCPU16_WORD)(vm->reg[DCPU16_REG_PC] + *pc_adjust),
-                sp = (DCPU16_WORD)(vm->reg[DCPU16_REG_PC] + *sp_adjust);
+                sp = (DCPU16_WORD)(vm->reg[DCPU16_REG_SP] + *sp_adjust);
 
     TRACE("%s>> is_a:%u pc:0x%04x sp:0x%04x value_data:0x%04x\n", 
           __func__,