From b8d69cbfdf513d2a719882d0afbba23760038de3 Mon Sep 17 00:00:00 2001 From: m8pple Date: Tue, 21 Oct 2014 10:23:36 +0100 Subject: Fixed #10: The documentation had an awkward blend of pseudo-code and real code, which never helps. Changed to be real code. (Deliberately kept the error checking though). --- include/mips_cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/mips_cpu.h b/include/mips_cpu.h index 5b66ab9..ef1ea6e 100644 --- a/include/mips_cpu.h +++ b/include/mips_cpu.h @@ -93,10 +93,12 @@ mips_error mips_cpu_get_pc( inspect what happened and find out what went wrong. So this should be true: - uint32_t pc=mips_cpu_get_pc(cpu); + uint32_t pcOrig, pcGot; + mips_cpu_get_pc(cpu, &pcOrig); mips_error err=mips_cpu_step(cpu); if(err!=mips_Success){ - assert(mips_cpu_get_pc(cpu)==pc); + mips_cpu_get_pc(cpu, &pcGot); + assert(pcOrig==pcGot); assert(mips_cpu_step(cpu)==err); } -- cgit