From 2407d4a9a8624353b048b732ae4ea350cf4c1296 Mon Sep 17 00:00:00 2001 From: Anthony Liu Date: Thu, 5 Dec 2013 23:48:36 +0800 Subject: [PATCH] Fix bug when processing interrupts Push current PC onto stack and take vector address from parameter. --- src/cpu8051.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.20.1