{"id":204,"date":"2022-02-13T20:00:28","date_gmt":"2022-02-14T01:00:28","guid":{"rendered":"https:\/\/paulcarbone.com\/50days\/?p=204"},"modified":"2022-02-13T20:00:28","modified_gmt":"2022-02-14T01:00:28","slug":"day-16-more-on-subroutines-jumps-indexing","status":"publish","type":"post","link":"https:\/\/paulcarbone.com\/50days\/2022\/02\/13\/day-16-more-on-subroutines-jumps-indexing\/","title":{"rendered":"Day 16: More on subroutines, jumps &#038; indexing"},"content":{"rendered":"<p>Lost a day yesterday due to the move and date night with the Wife.\u00a0 I&#8217;m doin&#8217; my best here&#8230;<\/p>\n<p>So my understanding of how relative &amp; indexed jumps work on the 8080 &amp; Z80 was just flawed.\u00a0 There&#8217;s no variable indexing, like on the 6800 or 6502, which is a super bummer.<br \/>\nMy original ideas was to have a register be the offset into a subroutine, so like you&#8217;d call the subroutine, and what was on the C register would end up selecting which part of the subroutine was run.\u00a0 I thought it was clever&#8230;\u00a0 I want to make a general purpose routine that can set or clear a specified bit in a control word.<br \/>\nLets for get set vs clear for now, and focus on selecting the bit.\u00a0\u00a0 The SET &amp; RES commands seemed cool at first, but are actually kind of useless, since you can&#8217;t select the bit from a register.\u00a0 So what if we go back to using RLCA, and we use C as a counter, to determine the # of rotates we make?\u00a0 Oh right, we tried this two days ago, and couldn&#8217;t verify if it worked. LET. TRY. AGAIN ( I&#8217;m super hating all of this).<br \/>\nLets test it on the LEDs on port0 instead of on the console &#8211; that should be more conclusive.<br \/>\nAND IT DOESN&#8217;T WORK. I HATE THIS . I&#8217;M DONE.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lost a day yesterday due to the move and date night with the Wife.\u00a0 I&#8217;m doin&#8217; my best here&#8230; So my understanding of how relative &amp; indexed jumps work on the 8080 &amp; Z80 was just flawed.\u00a0 There&#8217;s no variable &hellip; <a href=\"https:\/\/paulcarbone.com\/50days\/2022\/02\/13\/day-16-more-on-subroutines-jumps-indexing\/\">Continue reading <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":{"spay_email":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-204","post","type-post","status-publish","format-standard","hentry","category-blinkinglights"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":1,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts\/204\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}