aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm8pple <dt10@imperial.ac.uk>2014-10-21 10:23:36 +0100
committerm8pple <dt10@imperial.ac.uk>2014-10-21 10:25:43 +0100
commitb8d69cbfdf513d2a719882d0afbba23760038de3 (patch)
treed8a3c782065933500e75b04d0a20096760cf475c
parentd1c0122cb644c701c2e5790f042b5deaf3edde5f (diff)
downloadMipsCPU-b8d69cbfdf513d2a719882d0afbba23760038de3.tar.gz
MipsCPU-b8d69cbfdf513d2a719882d0afbba23760038de3.zip
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).
-rw-r--r--include/mips_cpu.h6
1 files 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);
}