{"id":4314,"date":"2019-10-17T22:45:13","date_gmt":"2019-10-18T01:45:13","guid":{"rendered":"https:\/\/tangopardo.com.ar\/2cf7\/?p=4314"},"modified":"2019-10-31T23:23:18","modified_gmt":"2019-11-01T02:23:18","slug":"hey-i-wrote-an-assembler","status":"publish","type":"post","link":"https:\/\/tangopardo.com.ar\/2cf7\/2019\/10\/17\/hey-i-wrote-an-assembler","title":{"rendered":"Hey, I wrote an assembler."},"content":{"rendered":"\n<p>(It was about time I interrupted a never ending pile of drafts with something)<\/p>\n\n\n\n<p>So, for a bit more than a month I&#8217;ve been attending a seminar on VHDL microcontroller design. <\/p>\n\n\n\n<p>One of the workshops involved doing some simple exercises on eval boards. While the overall instruction set is small (fits on less than a page) the idea of programming and then assembling the sources using pencil and paper wasn&#8217;t very appealing at the moment.<\/p>\n\n\n\n<p>It sure is a fun way to keep the mind fresh but given time constraints I couldn&#8217;t cope with such a long debugging cycle.<\/p>\n\n\n\n<p>And&#8230; The obvious path was to build a tool.<\/p>\n\n\n\n<p>I reused parts of <a href=\"https:\/\/github.com\/telescopio-montemayor\/python-lx200\">python-lx200<\/a> because smart data structures and dumb code are nice. Most of this could be implemented with M4 too, perhaps for another code golf session.<\/p>\n\n\n\n<p>A couple of years ago I&#8217;d probably tried to use Bison and Flex but doubt that I could manage something like this in just a handful of hours during the weekend.<\/p>\n\n\n\n<p>There are some rough edges but as it is it supports labels, variable definitions and emits a valid IHEX file. I made a couple of dumb mistakes but they were really evident when looking at what Quartus made of the output file.<\/p>\n\n\n\n<p>I&#8217;m quite proud of the result, I don&#8217;t know when was the last time I had so much fun doing a one off project, even if it wouldn&#8217;t be used anymore after the seminar.<\/p>\n\n\n\n<p>The source code lives here: <a href=\"https:\/\/github.com\/pardo-bsso\/islyd-asm\">https:\/\/github.com\/pardo-bsso\/islyd-asm<\/a><\/p>\n\n\n\n<p>  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>(It was about time I interrupted a never ending pile of drafts with something) So, for a bit more than a month I&#8217;ve been attending a seminar on VHDL microcontroller design. One of the workshops involved doing some simple exercises on eval boards. While the overall instruction set is small (fits on less than a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13,37,24,4,22],"tags":[101,100,60,64,102,103],"class_list":["post-4314","post","type-post","status-publish","format-standard","hentry","category-electronica","category-facultad","category-hacks","category-python","category-software-libre","tag-assembler","tag-hacks","tag-musings","tag-python","tag-unlp","tag-vhdl"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pmnbC-17A","_links":{"self":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/4314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/comments?post=4314"}],"version-history":[{"count":5,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/4314\/revisions"}],"predecessor-version":[{"id":4320,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/4314\/revisions\/4320"}],"wp:attachment":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/media?parent=4314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/categories?post=4314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/tags?post=4314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}