{"id":914,"date":"2012-05-13T22:58:29","date_gmt":"2012-05-13T22:58:29","guid":{"rendered":"http:\/\/www.linkovitch.me.uk\/blog\/?p=914"},"modified":"2014-10-20T13:04:02","modified_gmt":"2014-10-20T13:04:02","slug":"argh-bloody-risc-bugs","status":"publish","type":"post","link":"https:\/\/www.linkovitch.me.uk\/blog\/2012\/05\/argh-bloody-risc-bugs\/","title":{"rendered":"ARGH bloody RISC bugs!"},"content":{"rendered":"<p>I don&#8217;t have much hair, and with the aid of the Atari Jaguar RISC CPUs I am bound to have less with fun bugs like these.\u00c2\u00a0 I keep hitting this one, forgetting about it for a few mind numbing minutes\/hours\/days and then remember it and spend more minutes\/hours\/days resolving it.\u00c2\u00a0 So I thought I would scribble it here&#8230;<\/p>\n<p>I am not 100% certain if this is entirely the RISC CPU bug or MADMAC being a bit pants at alignment, but it is possible to generate &#8216;fun&#8217; alignment issues in your code by simply adding or removing a nop (or other similar 16bit only instruction).\u00c2\u00a0 The instruction doesn&#8217;t need to be called even! that&#8217;s how much fun this is!<\/p>\n<p>From what I can tell it seems that jump instructions are particularly fussy about where they are jumping to, so it is possible that by adding\/removing a 16bit instruction you will move a jump destination into one of these &#8216;un-desired&#8217; addresses and hey presto your RISC code suddenly stops working, or does something weird.\u00c2\u00a0 Even though you haven&#8217;t changed anything that should cause such behaviour.<\/p>\n<p>So if you are playing with Jaguar RISC code and using jumps and sometimes it randomly seems to stop working but then work again, this could be the cause.\u00c2\u00a0 How do you find which jump is being affected? trial and error is my best method, or add a nop just after the code you modified (doesn&#8217;t need to be the executed code block), one at a time until your code magically starts working again :\/<\/p>\n<p>One day I&#8217;ll fully track this down and come up with some fix\/work around.. probably :D\u00c2\u00a0 Until then, keep hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t have much hair, and with the aid of the Atari Jaguar RISC CPUs I am bound to have less with fun bugs like these.\u00c2\u00a0 I keep hitting this one, forgetting about it for a few mind numbing minutes\/hours\/days and then remember it and spend more minutes\/hours\/days resolving it.\u00c2\u00a0 So I thought I would &hellip; <a href=\"https:\/\/www.linkovitch.me.uk\/blog\/2012\/05\/argh-bloody-risc-bugs\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ARGH bloody RISC bugs!<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3,22],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/posts\/914"}],"collection":[{"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=914"}],"version-history":[{"count":1,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/posts\/914\/revisions"}],"predecessor-version":[{"id":915,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/posts\/914\/revisions\/915"}],"wp:attachment":[{"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linkovitch.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}