{"id":206,"date":"2022-02-14T19:59:11","date_gmt":"2022-02-15T00:59:11","guid":{"rendered":"https:\/\/paulcarbone.com\/50days\/?p=206"},"modified":"2022-02-14T19:59:11","modified_gmt":"2022-02-15T00:59:11","slug":"day-17-rotate-or","status":"publish","type":"post","link":"https:\/\/paulcarbone.com\/50days\/2022\/02\/14\/day-17-rotate-or\/","title":{"rendered":"Day 17: Rotate &#038; OR"},"content":{"rendered":"<p>Time to fail for another hour at assembly language&#8230;\u00a0 Yesterday I think the routines for writing to the console were tripping me up, so I&#8217;m going to start a new file with none of that and just write to port 0 for starters.<\/p>\n<p>So that &#8216;worked&#8217; and is predictable in terms of the # of shifts.\u00a0 Note though that CP\/M call 0 ends up wiping what&#8217;s on the output (or maybe only port 0 ?)<\/p>\n<p>For now, I&#8217;m not going to worry about getting input &#8211; I&#8217;m just going to hard code some EQU&#8217;s that would eventually be values passed to the routine by something else.<\/p>\n<p>HOORAY. it works.<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><div><code class=\"hljs language-php\">BITNM\tEQU\t<span class=\"hljs-number\">5<\/span>\t\t;THE BIT WERE GOING TO SET (PRESCALER)\nWORD\tEQU\t<span class=\"hljs-number\">0<\/span>\t\t;<span class=\"hljs-keyword\">EMPTY<\/span> WORD\nTIMER0\tEQU\t<span class=\"hljs-number\">40<\/span>H\t\t;WHERE TO SEND THE WORD\n\n; REAL SIMPLE NOW - <span class=\"hljs-keyword\">FOR<\/span> STARTERS, WE PASS THE WORD &amp; THE BIT TO THE \n; ROUTINE, <span class=\"hljs-keyword\">AND<\/span> IT WILL SET THAT SPECIFIED BIT, <span class=\"hljs-keyword\">AND<\/span> PUT IT ON PORT <span class=\"hljs-number\">0<\/span>\n; REGISTER C WILL BE THE COUNTER\n\nSTART:\tLD\tSP,STACK\t;SETUP STACK POINTER \t\n\n\tLD\tC,BITNM\t\t\n\tLD\tB,WORD\n\tCALL\tSETBIT\n\tLD\tC,<span class=\"hljs-number\">0<\/span>\n\tOUT\t(C),A\n\tHALT \n\nSETBIT: PUSH\tBC\t\t;SAVE REGISTERS\t\t\n\tPUSH\tDE\n\tPUSH \tHL\n\tLD\tA,<span class=\"hljs-number\">1<\/span>\nRTAT:\tRLCA \t\t\t\t\n\tDEC\tC\n\tJR\tNZ,RTAT\n\t<span class=\"hljs-keyword\">OR<\/span>\tB\n\tPOP\tHL\n\tPOP\tDE\n\tPOP\tBC\n\tRET\n<\/code><\/div><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>","protected":false},"excerpt":{"rendered":"<p>Time to fail for another hour at assembly language&#8230;\u00a0 Yesterday I think the routines for writing to the console were tripping me up, so I&#8217;m going to start a new file with none of that and just write to port &hellip; <a href=\"https:\/\/paulcarbone.com\/50days\/2022\/02\/14\/day-17-rotate-or\/\">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-206","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\/206","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=206"}],"version-history":[{"count":5,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/posts\/206\/revisions\/211"}],"wp:attachment":[{"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paulcarbone.com\/50days\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}