{"id":739,"date":"2015-03-10T08:00:24","date_gmt":"2015-03-10T15:00:24","guid":{"rendered":"http:\/\/www.pagetable.com\/?p=739"},"modified":"2015-03-10T08:00:24","modified_gmt":"2015-03-10T15:00:24","slug":"making-obsolete-code-run-again-the-mxass-6502-cross-assembler","status":"publish","type":"post","link":"https:\/\/www.pagetable.com\/?p=739","title":{"rendered":"Making Obsolete Code Run Again: The mxass 6502 Cross Assembler"},"content":{"rendered":"<p>Here&#8217;s the challenge: Take code that you wrote some 20 years ago in an obsolete programming language for an obsolete platform, make it run on a modern system (without emulation!)&#8230; and actually make it useful!<\/p>\n<p>In 1995, I started developing a 6502 Cross Assembler for MS-DOS, in my then favorite languages: <a href=\"http:\/\/en.wikipedia.org\/wiki\/PowerBASIC\">PowerBASIC<\/a> for the bulk of it, and lots of 8086 inline assembly to speed up string operations. I mostly used it for my own C64 projects, and I was very proud of its speed: A fraction of a second to produce several KB of binary code on a 386.<\/p>\n<p>In September 1996, I decided that <a href=\"http:\/\/en.wikipedia.org\/wiki\/Turbo_Pascal\">Turbo Pascal<\/a> was actually the better language, and converted the source line by line, but keeping all the inline assembly. Development continued until June 1998.<\/p>\n<p>In January 2008, I rediscovered the source and wanted to see whether it could be ported to run on modern computers. I used p2c to convert the Pascal source into C, and spend two days cleaning up the C and rewriting the assembly in C until it correctly compiled my regression test &#8211; but the code was still using Pascal strings, for example.<\/p>\n<p>Recently, I dug into my floppy disk collection to recover as many revisions of the source as possible, converted the whole (surviving) history into a git repository, and put it on<\/p>\n<p><a href=\"https:\/\/github.com\/mist64\/mxass\">github.com\/mist64\/mxass<\/a>.<\/p>\n<p>The C version of mxass should run on any modern operating system, and it&#8217;s actually a useful piece of software, with some unique features. It supports 6502 with illegal opcodes, 65816 and Z80 assembly, and it tries to be backwards compatible with the &#8220;<a href=\"http:\/\/de.wikipedia.org\/wiki\/64\u2019er\">64&#8217;er<\/a>&#8221; set of assemblers (<a href=\"http:\/\/csdb.dk\/release\/?id=111993\">Hypra-Ass<\/a>, <a href=\"http:\/\/csdb.dk\/release\/?id=36606\">Giga-Ass<\/a>, <a href=\"http:\/\/csdb.dk\/release\/?id=121409\">Vis-Ass<\/a>, <a href=\"http:\/\/csdb.dk\/release\/?id=99889\">Assblaster<\/a>, <a href=\"http:\/\/csdb.dk\/release\/?id=126584\">F8-Assblaster<\/a>), in fact, F8-Assblaster source printed to a file in an emulator should assemble with very few changes.<\/p>\n<p>That said, <i>please<\/i> do not use it for new projects. Use <a href=\"http:\/\/www.cc65.org\">cc65<\/a> for that.<\/p>\n<p>What is the oldest source you have written for an obsolete platform that have ported forward to modern systems?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the challenge: Take code that you wrote some 20 years ago in an obsolete programming language for an obsolete platform, make it run on a modern system (without emulation!)&#8230; and actually make it useful! In 1995, I started developing a 6502 Cross Assembler for MS-DOS, in my then favorite languages: PowerBASIC for the bulk &#8230; <a title=\"Making Obsolete Code Run Again: The mxass 6502 Cross Assembler\" class=\"read-more\" href=\"https:\/\/www.pagetable.com\/?p=739\" aria-label=\"Read more about Making Obsolete Code Run Again: The mxass 6502 Cross Assembler\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5,16],"tags":[],"class_list":["post-739","post","type-post","status-publish","format-standard","hentry","category-2","category-archeology","category-github"],"_links":{"self":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=739"}],"version-history":[{"count":0,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/739\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}