<div dir="ltr"><div dir="ltr">On Sun, Mar 27, 2022 at 11:18 PM Joerg <<a href="mailto:joerg.straube@iaeth.ch">joerg.straube@iaeth.ch</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">John<div><br></div><div>there is indeed an error in chapter 9.5 of the pdf you linked.</div><div><br></div><div>If you read bullet 3 in the intro to chapter 9.5 a distinction of adr>= 0 and adr<0 is mentioned for the memory mapped IO. But as mentioned in the intro, memory mapped IO is not implemented. For a fully working emulator you will need this IF adr>=0 and IF adr<0.</div><div>But for this reduced mini emulator code in chapter 9.5, this IF is wrong (most probably a leftover of the full code). Take the sample code Chris provided.</div><div><br><div dir="ltr">br<br><div>Jörg</div></div></div></div></blockquote><div><br></div><div>Thanks Jörg. </div><div><br></div><div>The complete sample code that I was referring to is the file RISC.Mod on Prof Wirth's site:</div><div><br></div><div><a href="http://people.inf.ethz.ch/wirth/CompilerConstruction/index.html">http://people.inf.ethz.ch/wirth/CompilerConstruction/index.html</a><br></div><div><br></div><div>The sample code that I quoted from the book was mistakenly taken from the earlier (2013) revision of the book that I have on my computer rather than the updated (2017) version on the website. I apologise for any confusion,</div><div><br></div><div>--</div><div>Regards,</div><div>Chris Burrows</div><div>CFB Software</div><div><a href="https://www.astrobe.com/RISC5">https://www.astrobe.com/RISC5</a></div><div><br></div><div><br></div><div> </div></div></div>