{"id":1610,"date":"2017-10-19T13:11:08","date_gmt":"2017-10-19T13:11:08","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?page_id=1610"},"modified":"2017-12-09T21:23:38","modified_gmt":"2017-12-09T21:23:38","slug":"cpm-programs","status":"publish","type":"page","link":"https:\/\/www.sydneysmith.com\/wordpress\/cpm-programs\/","title":{"rendered":"CP\/M Programs for Windows"},"content":{"rendered":"<p><a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/10\/ttt-main.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/10\/ttt-main-300x157.png\" alt=\"\" width=\"300\" height=\"157\" class=\"alignnone size-medium wp-image-1611\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/10\/ttt-main-300x157.png 300w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/10\/ttt-main-768x402.png 768w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/10\/ttt-main.png 979w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you understand the title, you&#8217;ll think this is pretty crazy.<\/p>\n<p>Certainly no-one would ever think to do a Google search for anything like that. Let me explain &#8230;<br \/>\n<!--more--><\/p>\n<p>CP\/M was an operating system for microcomputers, back in the 1970s mainly. It was useful. It was very capable. At the time. Time has moved on. Computers have moved on. Expectations have moved on. The new normal is far beyond the dreams of that era.<\/p>\n<p>Running a CP\/M program on a Windows computer just seems wrong in many ways. Yet, many of the programs provided functionality that is still relevant today. Just because a wheel was invented long ago, doesn&#8217;t make it less useful now. There might be some things we could learn from history. In the very least, it would be &#8220;Oh yeah, that approach &#8211; I&#8217;m glad we never do that any more.&#8221; However, it could also be &#8220;That&#8217;s right. That was a good approach. How would or could that apply today?&#8221;<\/p>\n<h2>Tic-Tac-Toe<\/h2>\n<p>After a fine introduction I now start talking about a very simple game. I do hope to get onto grander things later but tic-tac-toe (TTT) is what started this whole topic. I recently stumbled across a copy of tic-tac-toe written for CP\/M. (I was looking at old disk formats and the game happened to be inside a disk image from the era.) The program was written in C and I couldn&#8217;t help wondering, given that C is typically portable, whether it would compile and run on a more modern computer.<\/p>\n<p>The short answer was &#8220;no&#8221;. The longer answer was &#8220;yes&#8221;.<\/p>\n<p>Whilst portability has always been a strength of C, forty years have passed since CP\/M and the language has evolved a little since then. It&#8217;s not quite the same.<\/p>\n<p>To my recollection, it also seemed like a new C compiler was being released every second week in that era. I&#8217;m sure I&#8217;m wrong but there did seem to be a lot of them and they all had better features than all the rest. There was probably money to be made and so there was quite a bit of competition around. In practice, different compilers meant slight differences in how you&#8217;d write programs.<\/p>\n<p>Fortunately, the TTT program was written for the BDS C compiler which is one of the ones I&#8217;d used. If I&#8217;m remembering the right one, I liked BDS C. I hated that its libraries didn&#8217;t match the standard unix ones; but I loved that they included functions that let you do direct calls into CP\/M. This meant I could rewrite the libraries so that they did match unix. The versatility amazed me.<\/p>\n<p>Anyway, enough background. The program was released into the public domain, or was going to be. In either case, it now exists on one of the &#8220;abandonware&#8221; sites of old and long forgotten software. I&#8217;ve placed a copy in &#8220;<a href=\"http:\/\/www.sydneysmith.com\/products\/cpm-ttt\/ttt1.c\" rel=\"noopener\" target=\"_blank\">ttt1.c<\/a>&#8220;.<\/p>\n<p>So, what about the &#8220;running it in Windows&#8221; bit?<\/p>\n<p>I&#8217;ve made some mods to the program to get it to compile with a modern compiler (gcc) and compiled it for you. There is a ZIP file with the executable, the original source code, and a batch file to run it from Windows Explorer; in &#8220;<a href=\"http:\/\/www.sydneysmith.com\/products\/cpm-ttt\/ttt.zip\">ttt.zip<\/a>&#8220;. It is now a 32-bit Windows executable so it should run on any 32-bit or 64-bit Windows computer. The original was a &#8220;.com&#8221; file that ran on 8-bit CP\/M computers.<\/p>\n<p>There&#8217;s no installer, no icon, no registry settings. It just runs.<\/p>\n<p>For those of you that are only familiar with a Windows environment, it may be a shock as it uses console mode. Prompts will appear on the screen and you press keys in response. The original processed keys as you pressed them. The easiest way for me to get it going was to change that to press a key and then press ENTER.<\/p>\n<p>All credit for the program goes to the original author (see the source code). As usual, software is provided &#8220;as-is&#8221;. No responsibility is accepted if it doesn&#8217;t do what you wanted or expected.<\/p>\n<h2>Articles<\/h2>\n<p>I&#8217;ve written some <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/category\/articles\/cpm\/\">articles on CP\/M<\/a>.<\/p>\n<h2>Programs<\/h2>\n<p>There are a number of CP\/M programs that are still relevant, useful or usable in Windows. Here&#8217;s what I&#8217;ve gotten going so far:<\/p>\n<div class='catablog-catalog'><div class='catablog-row all cpm-ports'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/basic1-360x360.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/basic1-360x360.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/basic1\/'  >Basic1<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Old fashioned BASIC for new fashioned computers.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm-ports'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/mm-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/mm-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/cpm-mm\/'  >CP\/M Mastermind<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Which are the right letters and which are in the right spots?<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm-ports'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/pnum-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/pnum-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/cpm-pnum\/'  >CP\/M PNum<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Print a file with line numbers.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm-ports'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/pressup-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/pressup-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/cpm-pressup\/'  >CP\/M Pressup<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Be the first to press down their pegs.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm-ports'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/ttt-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/ttt-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/cpm-ttt'  >CP\/M TTT<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Tic Tac Toe.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><\/div><div class='catablog-navigation'><span class='catablog-navigation-link catablog-first-page-link catablog-disabled'>Previous<\/span> <\/div>\n<h2>8080 Emulators<\/h2>\n<p>There are also emulators around for 8080 CPUs and systems. Those will run CP\/M. They will also directly run all of the original 8-bit &#8220;.com&#8221; file programs without recompiling.<\/p>\n<h2>Z80 Emulators<\/h2>\n<p>I have two main Z80 emulators. These are z80emu, a HTML5 one that runs in your browser; and z80sim, a Windows program that runs on your desktop.<\/p>\n<p>There are also packages of z80sim that come with a disk image and a &#8220;run.bat&#8221; that allow you to run up an entire operating system with a single (double-)click.<\/p>\n<div class='catablog-catalog'><div class='catablog-row all cpm'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/run-cdos-icon.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/run-cdos-icon.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/run-cdos\/'  >Run CDOS<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>A one-click computer running CDOS 02.36 from long ago ...<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/run-cpm-icon.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/run-cpm-icon.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/run-cpm\/'  >Run CP\/M<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>A one-click computer running CP\/M 2.2 from long ago ...<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/run-cromix-360x360.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/run-cromix-360x360.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/run-cromix'  >Run Cromix<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>A multi-user, multi-tasking operating system on a Z80, on Windows!<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm free'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/z80emu-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/z80emu-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/z80emu\/'  >Z80 Emulator<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Run CP\/M Z80 programs in a web browser!<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm free'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/z80sim-main.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/z80sim-main.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/z80sim\/'  >Z80 Simulator<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Run a Z80 based system on your desktop.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><\/div><div class='catablog-navigation'><span class='catablog-navigation-link catablog-first-page-link catablog-disabled'>Previous<\/span> <\/div>\n<h1>CP\/M Tools<\/h1>\n<p>The following may be of use if you are building things related to CP\/M or Z80 processors.<br \/>\n<div class='catablog-catalog'><div class='catablog-row all cpm-tools'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/icon-360x360.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/icon-360x360.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/bin2hex\/'  >bin2hex<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Create Intel Hex files from a binary image.<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><div class='catablog-row all cpm-tools'>\n\t<div class=\"catablog-images-column\">\n\t\t<a href='https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/originals\/cpmfs-icon.png' class='catablog-image'  ><img src=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/catablog\/thumbnails\/cpmfs-icon.png\" alt=\"\" \/><\/a>\n\t\t\n\t<\/div>\n\t\n\t<h3 class='catablog-title'><a href='http:\/\/www.sydneysmith.com\/wordpress\/cpmfs'  >cpmfs<\/a><\/h3>\n\t\n\t<div class=\"catablog-description\">\n\t\t<p>Copy files between Windows and CP\/M<\/p>\n\t\t\n\t<\/div>\n\t\n<\/div><\/div><div class='catablog-navigation'><span class='catablog-navigation-link catablog-first-page-link catablog-disabled'>Previous<\/span> <\/div><\/p>\n<h2>More<\/h2>\n<p>You may be interested in my small collection of <a href=\"http:\/\/www.sydneysmith.com\/products\/cpm\/\" rel=\"noopener\" target=\"_blank\">CP\/M related programs, source code and disk images<\/a>.<\/p>\n<p>Other useful links:<br \/>\n<a href=\"https:\/\/amaus.org\/static\/S100\/\" rel=\"noopener\" target=\"_blank\">https:\/\/amaus.org\/static\/S100\/<\/a><br \/>\n<a href=\"http:\/\/www.z80.info\/z80emu.htm\" rel=\"noopener\" target=\"_blank\">http:\/\/www.z80.info\/z80emu.htm<\/a><br \/>\n<a href=\"http:\/\/www.autometer.de\/unix4fun\/z80pack\/ftp\/\" rel=\"noopener\" target=\"_blank\">http:\/\/www.autometer.de\/unix4fun\/z80pack\/ftp\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you understand the title, you&#8217;ll think this is pretty crazy. Certainly no-one would ever think to do a Google search for anything like that. Let me explain &#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/pages\/1610"}],"collection":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1610"}],"version-history":[{"count":15,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/pages\/1610\/revisions"}],"predecessor-version":[{"id":1781,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/pages\/1610\/revisions\/1781"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}