{"id":626,"date":"2025-05-18T16:05:58","date_gmt":"2025-05-18T06:05:58","guid":{"rendered":"http:\/\/electricadventures.net\/?p=626"},"modified":"2025-05-18T16:05:58","modified_gmt":"2025-05-18T06:05:58","slug":"lets-make-a-retro-game-ep-3-editor-assembler","status":"publish","type":"post","link":"https:\/\/electricadventures.net\/?p=626","title":{"rendered":"Lets Make a Retro Game: Ep 3: Editor\/Assembler"},"content":{"rendered":"\n<p>In this episode, we are going to cover setting up a free text editor and Z80 assembler with Syntax Highlighting and an execute key that will compile our code and assist in seeing any errors.<\/p>\n\n\n\n<p>I have included templates for Colecovision, original Spectravideo and MSX systems that will give you something to look at, compile and run in the emulator.<\/p>\n\n\n\n<p>The video for this episode is available here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Lets Make a Retro Game - Episode 3 - Editor\/Assembler\/Templates\" width=\"960\" height=\"540\" src=\"https:\/\/www.youtube.com\/embed\/tehseJqEchc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Next episode, we will be taking a closer look at Z80 assembler code, breaking down these templates and covering what they do.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"151\" height=\"151\" src=\"http:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-80.png\" alt=\"\" class=\"wp-image-631\"\/><\/figure>\n\n\n\n<p>For this episode, you will need to download the following items:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ConTEXT Text Editor<\/h3>\n\n\n\n<p><a href=\"http:\/\/www.contexteditor.org\/\">http:\/\/www.contexteditor.org\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Z80 Syntax Markup file for ConTEXT (WLA-Z80 Assembler)<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/WLADXZ80Assembler.zip\">WLADXZ80Assembler Markup Files<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TNIAsm (version 0.45)<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/tniasm045.zip\">tniasm 045<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MSX , Spectravideo and Colecovision Assembler Templates<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/Template-Coleco.zip\">Colecovision<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/Template-MSX.zip\">MSX<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/Template-Spectravideo.zip\">Spectravideo<\/a><\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Step 1 \u2013 Setting up the text editor<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Download and Install<\/h2>\n\n\n\n<p>Download ConTEXT and then install using the default settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up Z80 Syntax Highlighting<\/h2>\n\n\n\n<p>Next, to make our Z80 assembly code more readable, we need to add a highlighter file that will colour the different parts of our assembly code.&nbsp;This makes it much easier to read and see what is going on in our code.<\/p>\n\n\n\n<p>Download the \u201cWLA DX Z80 Assembler.chl\u201d file and put it in the following directory:<\/p>\n\n\n\n<p>C:\\Program Files (x86)\\ConTEXT\\Highlighters<\/p>\n\n\n\n<p>This directory will be the following if you have a 32-bit version of Windows:<\/p>\n\n\n\n<p>C:\\Program Files\\ConTEXT\\Highlighters<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 2 \u2013 Setup the Z80 Assembler<\/h1>\n\n\n\n<p>Next, we need to set up the Z80 Assembler.<\/p>\n\n\n\n<p>Download the freely available version of the Z80 Assembler by TNI and unzip it to the following directory:<\/p>\n\n\n\n<p>C:\\tniasm045<\/p>\n\n\n\n<p>Inside the directory, you should see the following files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>tniasm.exe<\/li>\n\n\n\n<li>tniasm.txt<\/li>\n<\/ul>\n\n\n\n<p>It is a great free Z80 assembler with lots of features. There is a 1.0 version that will be released at some stage, so show your interest by sending an email to the current developers.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Step 3 \u2013 Add an execute key to ConTEXT for the Assembler<\/h1>\n\n\n\n<p>To make things easier while editing and debugging our Z80 code using ConTEXT you can add an \u2018Execute Key\u2019 to compile the currently open file using the TNI Assembler, and most importantly show any errors from the compile, which you can then use to jump to the error line.<\/p>\n\n\n\n<p>Open an assembler source file, e.g. Template.asm, in either the MSX or Coleco templates.<\/p>\n\n\n\n<p>Go to Options from the top menu and select \u2018Environment Options\u2019<\/p>\n\n\n\n<p>Click on the \u2018Execute Keys\u2019 tab, and you should see the following screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"278\" height=\"344\" src=\"http:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-79.png\" alt=\"\" class=\"wp-image-630\" srcset=\"https:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-79.png 278w, https:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-79-242x300.png 242w\" sizes=\"auto, (max-width: 278px) 100vw, 278px\" \/><\/figure>\n\n\n\n<p>Then click on the \u2018Add\u2019 button and you should see the following screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"241\" height=\"141\" src=\"http:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-78.png\" alt=\"\" class=\"wp-image-629\"\/><\/figure>\n\n\n\n<p>Enter \u2018asm,z80\u2019 (don\u2019t type the quotes) and press [OK]<\/p>\n\n\n\n<p>On the left, you should now see:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"136\" height=\"245\" src=\"http:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-77.png\" alt=\"\" class=\"wp-image-628\"\/><\/figure>\n\n\n\n<p>Click on the function key you want to use e.g. F9 and then on the right fill in the fields as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Field<\/td><td>Value to Enter<\/td><\/tr><tr><td>Execute<\/td><td>c:\\tniasm045\\tniasm.exe<\/td><\/tr><tr><td>Start in<\/td><td>%p<\/td><\/tr><tr><td>Parameters<\/td><td>%n<\/td><\/tr><tr><td>Window<\/td><td>Normal<\/td><\/tr><tr><td>Hint<\/td><td>Compile<\/td><\/tr><tr><td>Save<\/td><td>Current file before execution<\/td><\/tr><tr><td>Use short DOS names<\/td><td>Not ticked<\/td><\/tr><tr><td>Capture console output<\/td><td>Ticked<\/td><\/tr><tr><td>Compiler output parser rule<\/td><td>*line %l(%n)*<\/td><\/tr><tr><td>Scroll console to the last line<\/td><td>Ticked<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Afterwards, your screen should look like the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"278\" height=\"344\" src=\"http:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-76.png\" alt=\"\" class=\"wp-image-627\" srcset=\"https:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-76.png 278w, https:\/\/electricadventures.net\/wp-content\/uploads\/2025\/05\/image-76-242x300.png 242w\" sizes=\"auto, (max-width: 278px) 100vw, 278px\" \/><\/figure>\n\n\n\n<p>Once you press [OK], you should be able to press the key you selected, and the current file will be compiled and the output shown in a window at the bottom of the program.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">The Templates<\/h1>\n\n\n\n<p>To get things started, I have included three templates with this episode, all three achieve the same output, but are for the MSX and Spectravideo computers and the Colecovision console.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this episode, we are going to cover setting up a free text editor and Z80 assembler with Syntax Highlighting and an execute key that will compile our code and assist in seeing any errors. I have included templates for Colecovision, original Spectravideo and MSX systems that will give you something to look at, compile<\/p>\n","protected":false},"author":1,"featured_media":630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[],"class_list":["post-626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lets-make-a-retro-game"],"acf":[],"_links":{"self":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=626"}],"version-history":[{"count":1,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/626\/revisions"}],"predecessor-version":[{"id":632,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/626\/revisions\/632"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/media\/630"}],"wp:attachment":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}