From: Anthony Liu Date: Thu, 5 Dec 2013 15:48:36 +0000 (+0800) Subject: Fix bug when processing interrupts X-Git-Tag: v2.0.0~30 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=2407d4a9a8624353b048b732ae4ea350cf4c1296;p=emu8051.git Fix bug when processing interrupts Push current PC onto stack and take vector address from parameter. --- diff --git a/src/cpu8051.c b/src/cpu8051.c index 6480853..956ae7d 100644 --- a/src/cpu8051.c +++ b/src/cpu8051.c @@ -226,8 +226,8 @@ cpu8051_ReadB(uint8_t bit_address) static void cpu8051_process_interrupt(int pc, int pri) { - stack_push16(pc); - cpu8051.pc = 0x0B; + stack_push16(cpu8051.pc); + cpu8051.pc = pc; cpu8051.active_priority = pri; }