{"id":645,"date":"2023-05-03T14:00:43","date_gmt":"2023-05-03T12:00:43","guid":{"rendered":"https:\/\/mo5.com\/micral\/?p=645"},"modified":"2023-05-03T14:45:55","modified_gmt":"2023-05-03T12:45:55","slug":"programmer-le-micral-n","status":"publish","type":"post","link":"http:\/\/mo5.com\/en\/programmer-le-micral-n\/","title":{"rendered":"Programming the Micral N"},"content":{"rendered":"<p><em>By Sylvain Glaize<\/em><\/p>\n<p>So we have functional hardware, functional emulation. We also have everything we need to communicate with the machine via the serial port. It's time to plan a few programs that could be run.<\/p>\n<p>To do this, we plan to use a floppy drive simulator, but this part will be covered in a future article.<\/p>\n<p>For the moment, let's talk about programming the Micral N.<\/p>\n<h2>The boot<\/h2>\n<p>When the machine starts up in our example configuration, the ROM on the boot card fetches data from a floppy drive.<\/p>\n<p>This is not compulsory on a Micral N, which could directly contain software to be executed, or read data from another device. Our configuration seems to be designed to accommodate software that can be easily modified.<\/p>\n<p>This boot program reads the first 14 kilobytes of data from the floppy disk and copies them to RAM from the low addresses. The boot card is then in a mode where data is read from ROM, but written to RAM for common addresses.<\/p>\n<p>Once the data has been loaded, the program resets the machine, which is indicated by the boot card that no longer allows access to the ROM. This means that the program coming from the floppy disk is fully available, and has complete control of the machine.<\/p>\n<h2>The system<\/h2>\n<p>We have no original software for this machine, apart from the contents of the two ROMs. However, it is possible to imagine that this data could either constitute a programme used directly or an operating system.<\/p>\n<p>The 2 kilobytes of the monitor at the top of the memory are not a system in themselves. It is a program that can be entered to operate and debug the machine. But this part is not built as a system from which you can call predefined functions. In fact, this monitor ROM could just as easily be replaced by RAM.<\/p>\n<h2>Special features of the boot programme<\/h2>\n<p>This very short program (199 useful bytes) uses the two Stack\/Channel cards. One of them is used as secondary memory in the form of a stack. The 8008 does not have RAM stack management like the Z80. This processor only has a very small address stack, internal and not accessible, which is used for subroutine calls.<\/p>\n<p>This secondary memory card is used to calculate the checksum of data read from the floppy disk, without the need for RAM, which is being filled with this data.<\/p>\n<p>This tells us that to write to this stack, you need to use the `OUT $16` instruction (send to output port number $16 in hexadecimal). To read from the stack, use the instruction `INP $6` (read from input port number 6).<\/p>\n<p>The other card acts as a read buffer. The program places the expected number of bytes in the buffer, then asks the disk controller to start reading. Once the expected number of bytes has been received by the card, it signals this and the processor can then read and process them.<\/p>\n<h2>The passage of time<\/h2>\n<p>Another interesting feature of this boot program is the use of the clock generated by the processor card. This function is theoretically optional, as it can be deactivated. However, on our example, it is compulsory.<\/p>\n<p>Each clock stroke generates an interrupt on the 8008, which connects to `Reset 7' at address $38 (Z80 users will recognise this). This address contains a counter management system, which is initialised and then read in a routine that acts as a waiting loop for a specific time.<\/p>\n<p>This routine is needed to generate the signals sent to the floppy disk controller card.<\/p>\n<h2>Special features of the monitor<\/h2>\n<p>The first particularity of the monitor is that it has to be called explicitly. Either from a program in RAM, or from a sequence entered via the control panel.<\/p>\n<p>This program needs a reserved area of RAM to house some operating variables, between $070e and $07ff. Keep this in mind if you want to use a program in RAM at the same time as the monitor.<\/p>\n<p>These variables store the state of the registers at the time of arrival in the monitor. With one notable exception: it is not possible to access the instruction pointer (PC register) from within a program.<\/p>\n<p>Another of these variables is used as a trampoline for programming an indirect jump. There is no instruction in 8008 to make a jump to the address contained in a register. This sequence therefore has to be generated using self-modifying code.<\/p>\n<p>In the monitor, this is done in two steps: first modify the destination address of a jump instruction (`JMP`) from a register. Then make a jump to the absolute address of this modified instruction.<\/p>\n<p>This technique is used throughout the monitor code, in conjunction with the use of the Stack card to track subroutine call stacks. My analysis is that, at the cost of some slowness, this preserves the 8008's internal call stack. There is never more than one subroutine call depth in the monitor.<\/p>\n<h2>Reading and writing<\/h2>\n<p>Another very interesting part of the monitor is that the program reads and writes to the serial port. It can also read and write to punched tape hardware. It can even inject data from a punched tape into memory.<\/p>\n<p>But we are primarily interested in the exchanges with the serial input\/output card.<\/p>\n<p>And this system is very simple: when writing, a bit is read until it indicates that the card is ready to receive. As soon as it is ready, the byte is sent. For reading, it's almost the same: wait for a bit indicating that the data can be read, then read a byte until it is different from 255.<\/p>\n<p>The protocol, including the data rate, is managed by the serial card. So there's no need to worry about processor time.<\/p>\n<h2>Level 1: House track<\/h2>\n<p>The first program I wrote for real hardware was a chaser: a program that lights up the LEDs on the control panel one after the other.<\/p>\n<p>It's a standard. And above all, it ensured that the programme was executed without having to connect the serial link.<\/p>\n<p>As it is not possible to access the LEDs directly from the control panel, which only displays what is on the address and data buses, the classic trick is to loop through a program located at particular addresses in order to generate the display of the correct LEDs.<\/p>\n<p>A small timer loop is therefore located at addresses $0100, $0200, $0400, $0800, $1000 and $2000.<\/p>\n<p>The programme also sends an ASCII version of the association's logo to the serial port.<\/p>\n<div id=\"attachment_20659\" style=\"width: 584px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20659\" class=\"wp-image-20659 size-full\" title=\"20230501 MicralN Emulation TTY Chenillard\" src=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-TTY-Chenillard.png\" alt=\"\" width=\"574\" height=\"178\" srcset=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-TTY-Chenillard.png 574w, https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-TTY-Chenillard-300x93.png 300w\"  sizes=\"(max-width: 574px) 100vw, 574px\" \/><p id=\"caption-attachment-20659\" class=\"wp-caption-text\">MO5.com \"logo\" displayed on the serial output.<\/p><\/div>\n<div id=\"attachment_20658\" style=\"width: 484px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20658\" class=\"wp-image-20658 size-full\" title=\"20230501 MicralN Emulation Panel Chenillard\" src=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif\" alt=\"20230501 MicralN Emulation Panel Chenillard\" width=\"474\" height=\"268\" \/><p id=\"caption-attachment-20658\" class=\"wp-caption-text\">Track displayed on the control panel, on the Micral N emulator (the LEDs are green on the emulator, not red as on the real hardware)<\/p><\/div>\n<h2>Level 2: Shooting Stars<\/h2>\n<p>Although we were unable to find any software specifically written for Micral N, there is some for other machines built around the 8008. This is the case with the SCELBI, on which a few game programs can be found.<\/p>\n<p>I chose one, called Shooting Stars, because it's quite simple, and I adapted it.<\/p>\n<p>Here it is on the emulator, waiting to see it run on the real machine.<\/p>\n<div id=\"attachment_20660\" style=\"width: 400px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20660\" class=\"wp-image-20660 size-full\" title=\"20230501 MicralN Emulation ShootingStars\" src=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-ShootingStars.png\" alt=\"20230501 MicralN Emulation ShootingStars\" width=\"390\" height=\"571\" srcset=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-ShootingStars.png 390w, https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-ShootingStars-205x300.png 205w\"  sizes=\"(max-width: 390px) 100vw, 390px\" \/><p id=\"caption-attachment-20660\" class=\"wp-caption-text\">The Shooting Stars game, originally created for SCELBI, has been ported to Micral N<\/p><\/div>\n<h2>Level 3: a BASIC<\/h2>\n<p>For this third experiment, SCELBI was again used to help us out. In fact, a version of BASIC has been implemented under the name SCELBAL, and the sources are available and documented.<\/p>\n<p>A few adaptations were necessary, but the programme was well thought out enough to be easily modified. There are even plans to be able to plug in program save and load routines, which would be perfectly possible on the Micral N with its floppy disk controller.<\/p>\n<p>However, it's not an exercise I've taken to that extreme.<\/p>\n<p>In the meantime, let's program in BASIC in the Micral N emulator.<\/p>\n<div id=\"attachment_20661\" style=\"width: 535px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-20661\" class=\"wp-image-20661 size-full\" title=\"20230501 MicralN Emulation Scelbal\" src=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Scelbal.png\" alt=\"20230501 MicralN Emulation Scelbal\" width=\"525\" height=\"261\" srcset=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Scelbal.png 525w, https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Scelbal-300x149.png 300w\"  sizes=\"(max-width: 525px) 100vw, 525px\" \/><p id=\"caption-attachment-20661\" class=\"wp-caption-text\">SCELBAL, the BASIC of SCELBI, ported to Micral N<\/p><\/div>\n<p>Now we're almost there. All that's left is to put these programs on the floppy disk emulator, plug everything in and let the magic happen.<\/p>\n<p>This will be the subject of the next article.<\/p>\n<p>In the meantime, don't forget to take part in our campaign! <a href=\"https:\/\/micral.mo5.com\">https:\/\/micral.mo5.com<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Par Sylvain Glaize Nous avons donc un mat\u00e9riel fonctionnel, une \u00e9mulation fonctionnelle. Nous avons aussi de quoi communiquer avec la machine via le port s\u00e9rie. Il est temps de pr\u00e9voir quelques programmes qui pourraient \u00eatre lanc\u00e9s. Pour cela, il est pr\u00e9vu d&#8217;utiliser un simulateur de lecteur de disquette, mais cette partie l\u00e0 viendra dans un article futur. Pour le moment, parlons programmation du Micral N. Le boot Au d\u00e9marrage de la machine dans la configuration de notre exemplaire, la ROM pr\u00e9sente sur la carte de \u00ab boot \u00bb se charge d&#8217;aller chercher des donn\u00e9es depuis un lecteur de disquette. Ce n&#8217;est pas obligatoire sur un Micral N, qui pourrait contenir directement un logiciel \u00e0 ex\u00e9cuter, ou bien lire des donn\u00e9es depuis un autre p\u00e9riph\u00e9rique. Notre configuration semble \u00eatre faite pour s&#8217;adapter \u00e0 un logiciel qui peut \u00eatre modifi\u00e9 facilement. Ce programme de d\u00e9marrage lit les 14 premiers kilo-octets de donn\u00e9es pr\u00e9sents sur la disquette et les copie en m\u00e9moire vive \u00e0 partir des adresses basses. La carte de \u00ab boot \u00bb est alors dans un mode o\u00f9 la lecture de donn\u00e9es se fait depuis la ROM, mais o\u00f9 l&#8217;\u00e9criture se fait en RAM pour les adresses communes. Une fois le chargement des donn\u00e9es termin\u00e9, le programme provoque un reset de la machine, qui est rep\u00e9r\u00e9 par la carte de \u00ab boot \u00bb qui ne permet plus l&#8217;acc\u00e8s \u00e0 la ROM. Ainsi, le programme venant de la disquette est enti\u00e8rement disponible, et a le contr\u00f4le complet de la machine. Le syst\u00e8me Nous n&#8217;avons pas de logiciel original pour cette machine, \u00e0 part le contenu des deux ROMs. Cependant, il est possible d&#8217;imaginer que ces donn\u00e9es peuvent soit constituer un programme utilis\u00e9 directement soit un syst\u00e8me d&#8217;exploitation. Les 2 kilo-octets du moniteur en haut de la m\u00e9moire ne forment pas un syst\u00e8me en soit. C&#8217;est un programme dans lequel on peut entrer pour op\u00e9rer et debugger la machine. Mais cette partie n&#8217;est pas construite comme un syst\u00e8me dont on pourrait appeler des fonctions pr\u00e9d\u00e9finies. En fait, cette ROM moniteur pourrait \u00eatre tout aussi bien remplac\u00e9e par de la RAM. Particularit\u00e9s du programme de boot Ce programme, tr\u00e8s court (199 octets utiles), utilise les deux cartes Pile\/Canal. L&#8217;une d&#8217;elles est utilis\u00e9e comme m\u00e9moire secondaire sous forme de pile. En effet, le 8008 n&#8217;a pas de gestion de pile en RAM comme on peut en trouver sur le Z80. Ce processeur n&#8217;a qu&#8217;une toute petite pile d&#8217;adresses, interne et non accessible, qui servent aux appels de sous-routines. Cette carte de m\u00e9moire secondaire sert pour calculer la somme de contr\u00f4le des donn\u00e9es lues depuis la disquette, sans avoir besoin de la RAM, qui est en train d&#8217;\u00eatre remplie par ces dites donn\u00e9es. Cela nous apprend donc que pour \u00e9crire dans cette pile, il faut utiliser l&#8217;instruction `OUT $16` (envoyer sur le port de sortie num\u00e9ro $16 en hexad\u00e9cimal). Pour lire depuis la pile, il faut utiliser l&#8217;instruction `INP $6` (lire depuis le porte d&#8217;entr\u00e9e num\u00e9ro 6). L&#8217;autre carte sert de buffer de lecture. Le programme y place le nombre d&#8217;octets attendus, puis demande au contr\u00f4leur de disquette de lancer la lecture. Une fois le nombre [&hellip;]<\/p>\n","protected":false},"author":329,"featured_media":20658,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"give_campaign_id":0,"footnotes":""},"categories":[1485,1502],"tags":[],"class_list":["post-645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-micral","category-programmation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Programmer le Micral N - MO5.COM<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mo5.com\/en\/programmer-le-micral-n\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Programmer le Micral N - MO5.COM\" \/>\n<meta property=\"og:description\" content=\"Par Sylvain Glaize Nous avons donc un mat\u00e9riel fonctionnel, une \u00e9mulation fonctionnelle. Nous avons aussi de quoi communiquer avec la machine via le port s\u00e9rie. Il est temps de pr\u00e9voir quelques programmes qui pourraient \u00eatre lanc\u00e9s. Pour cela, il est pr\u00e9vu d&#8217;utiliser un simulateur de lecteur de disquette, mais cette partie l\u00e0 viendra dans un article futur. Pour le moment, parlons programmation du Micral N. Le boot Au d\u00e9marrage de la machine dans la configuration de notre exemplaire, la ROM pr\u00e9sente sur la carte de \u00ab boot \u00bb se charge d&#8217;aller chercher des donn\u00e9es depuis un lecteur de disquette. Ce n&#8217;est pas obligatoire sur un Micral N, qui pourrait contenir directement un logiciel \u00e0 ex\u00e9cuter, ou bien lire des donn\u00e9es depuis un autre p\u00e9riph\u00e9rique. Notre configuration semble \u00eatre faite pour s&#8217;adapter \u00e0 un logiciel qui peut \u00eatre modifi\u00e9 facilement. Ce programme de d\u00e9marrage lit les 14 premiers kilo-octets de donn\u00e9es pr\u00e9sents sur la disquette et les copie en m\u00e9moire vive \u00e0 partir des adresses basses. La carte de \u00ab boot \u00bb est alors dans un mode o\u00f9 la lecture de donn\u00e9es se fait depuis la ROM, mais o\u00f9 l&#8217;\u00e9criture se fait en RAM pour les adresses communes. Une fois le chargement des donn\u00e9es termin\u00e9, le programme provoque un reset de la machine, qui est rep\u00e9r\u00e9 par la carte de \u00ab boot \u00bb qui ne permet plus l&#8217;acc\u00e8s \u00e0 la ROM. Ainsi, le programme venant de la disquette est enti\u00e8rement disponible, et a le contr\u00f4le complet de la machine. Le syst\u00e8me Nous n&#8217;avons pas de logiciel original pour cette machine, \u00e0 part le contenu des deux ROMs. Cependant, il est possible d&#8217;imaginer que ces donn\u00e9es peuvent soit constituer un programme utilis\u00e9 directement soit un syst\u00e8me d&#8217;exploitation. Les 2 kilo-octets du moniteur en haut de la m\u00e9moire ne forment pas un syst\u00e8me en soit. C&#8217;est un programme dans lequel on peut entrer pour op\u00e9rer et debugger la machine. Mais cette partie n&#8217;est pas construite comme un syst\u00e8me dont on pourrait appeler des fonctions pr\u00e9d\u00e9finies. En fait, cette ROM moniteur pourrait \u00eatre tout aussi bien remplac\u00e9e par de la RAM. Particularit\u00e9s du programme de boot Ce programme, tr\u00e8s court (199 octets utiles), utilise les deux cartes Pile\/Canal. L&#8217;une d&#8217;elles est utilis\u00e9e comme m\u00e9moire secondaire sous forme de pile. En effet, le 8008 n&#8217;a pas de gestion de pile en RAM comme on peut en trouver sur le Z80. Ce processeur n&#8217;a qu&#8217;une toute petite pile d&#8217;adresses, interne et non accessible, qui servent aux appels de sous-routines. Cette carte de m\u00e9moire secondaire sert pour calculer la somme de contr\u00f4le des donn\u00e9es lues depuis la disquette, sans avoir besoin de la RAM, qui est en train d&#8217;\u00eatre remplie par ces dites donn\u00e9es. Cela nous apprend donc que pour \u00e9crire dans cette pile, il faut utiliser l&#8217;instruction `OUT $16` (envoyer sur le port de sortie num\u00e9ro $16 en hexad\u00e9cimal). Pour lire depuis la pile, il faut utiliser l&#8217;instruction `INP $6` (lire depuis le porte d&#8217;entr\u00e9e num\u00e9ro 6). L&#8217;autre carte sert de buffer de lecture. Le programme y place le nombre d&#8217;octets attendus, puis demande au contr\u00f4leur de disquette de lancer la lecture. Une fois le nombre [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mo5.com\/en\/programmer-le-micral-n\/\" \/>\n<meta property=\"og:site_name\" content=\"MO5.COM\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/Association-MO5COM\/9540357570\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-03T12:00:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-03T12:45:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"474\" \/>\n\t<meta property=\"og:image:height\" content=\"268\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Sylvain Glaize\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@assomo5\" \/>\n<meta name=\"twitter:site\" content=\"@assomo5\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sylvain Glaize\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/\"},\"author\":{\"name\":\"Sylvain Glaize\",\"@id\":\"https:\\\/\\\/mo5.com\\\/#\\\/schema\\\/person\\\/e2593639b2e77eace001e56b26086749\"},\"headline\":\"Programmer le Micral N\",\"datePublished\":\"2023-05-03T12:00:43+00:00\",\"dateModified\":\"2023-05-03T12:45:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/\"},\"wordCount\":1637,\"publisher\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/20230501-MicralN-Emulation-Panel-Chenillard.gif\",\"articleSection\":[\"Micral\",\"Programmation\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/\",\"url\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/\",\"name\":\"Programmer le Micral N - MO5.COM\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/20230501-MicralN-Emulation-Panel-Chenillard.gif\",\"datePublished\":\"2023-05-03T12:00:43+00:00\",\"dateModified\":\"2023-05-03T12:45:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/20230501-MicralN-Emulation-Panel-Chenillard.gif\",\"contentUrl\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/20230501-MicralN-Emulation-Panel-Chenillard.gif\",\"width\":474,\"height\":268,\"caption\":\"Chenillard en action sur l'\u00e9mulateur Micral N\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mo5.com\\\/programmer-le-micral-n\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/mo5.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programmer le Micral N\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mo5.com\\\/#website\",\"url\":\"https:\\\/\\\/mo5.com\\\/\",\"name\":\"MO5.COM\",\"description\":\"Pr\u00e9server, explorer, rejouer\",\"publisher\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mo5.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mo5.com\\\/#organization\",\"name\":\"Association MO5.COM\",\"url\":\"https:\\\/\\\/mo5.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/mo5.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/Logo_MO5_A_Colo_Texte_Bleu-e1697059504554.png\",\"contentUrl\":\"https:\\\/\\\/mo5.com\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/Logo_MO5_A_Colo_Texte_Bleu-e1697059504554.png\",\"width\":2094,\"height\":559,\"caption\":\"Association MO5.COM\"},\"image\":{\"@id\":\"https:\\\/\\\/mo5.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/pages\\\/Association-MO5COM\\\/9540357570\",\"https:\\\/\\\/x.com\\\/assomo5\",\"http:\\\/\\\/www.instagram.com\\\/assomo5\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCRncMsBo89C9u_8gpWnsOVw\\\/featured\",\"https:\\\/\\\/bsky.app\\\/profile\\\/assomo5.bsky.social\",\"https:\\\/\\\/twitch.tv\\\/mo5assoretro\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mo5.com\\\/#\\\/schema\\\/person\\\/e2593639b2e77eace001e56b26086749\",\"name\":\"Sylvain Glaize\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g\",\"caption\":\"Sylvain Glaize\"},\"url\":\"http:\\\/\\\/mo5.com\\\/en\\\/author\\\/mokona78\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Programming the Micral N - MO5.COM","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mo5.com\/en\/programmer-le-micral-n\/","og_locale":"en_GB","og_type":"article","og_title":"Programmer le Micral N - MO5.COM","og_description":"Par Sylvain Glaize Nous avons donc un mat\u00e9riel fonctionnel, une \u00e9mulation fonctionnelle. Nous avons aussi de quoi communiquer avec la machine via le port s\u00e9rie. Il est temps de pr\u00e9voir quelques programmes qui pourraient \u00eatre lanc\u00e9s. Pour cela, il est pr\u00e9vu d&#8217;utiliser un simulateur de lecteur de disquette, mais cette partie l\u00e0 viendra dans un article futur. Pour le moment, parlons programmation du Micral N. Le boot Au d\u00e9marrage de la machine dans la configuration de notre exemplaire, la ROM pr\u00e9sente sur la carte de \u00ab boot \u00bb se charge d&#8217;aller chercher des donn\u00e9es depuis un lecteur de disquette. Ce n&#8217;est pas obligatoire sur un Micral N, qui pourrait contenir directement un logiciel \u00e0 ex\u00e9cuter, ou bien lire des donn\u00e9es depuis un autre p\u00e9riph\u00e9rique. Notre configuration semble \u00eatre faite pour s&#8217;adapter \u00e0 un logiciel qui peut \u00eatre modifi\u00e9 facilement. Ce programme de d\u00e9marrage lit les 14 premiers kilo-octets de donn\u00e9es pr\u00e9sents sur la disquette et les copie en m\u00e9moire vive \u00e0 partir des adresses basses. La carte de \u00ab boot \u00bb est alors dans un mode o\u00f9 la lecture de donn\u00e9es se fait depuis la ROM, mais o\u00f9 l&#8217;\u00e9criture se fait en RAM pour les adresses communes. Une fois le chargement des donn\u00e9es termin\u00e9, le programme provoque un reset de la machine, qui est rep\u00e9r\u00e9 par la carte de \u00ab boot \u00bb qui ne permet plus l&#8217;acc\u00e8s \u00e0 la ROM. Ainsi, le programme venant de la disquette est enti\u00e8rement disponible, et a le contr\u00f4le complet de la machine. Le syst\u00e8me Nous n&#8217;avons pas de logiciel original pour cette machine, \u00e0 part le contenu des deux ROMs. Cependant, il est possible d&#8217;imaginer que ces donn\u00e9es peuvent soit constituer un programme utilis\u00e9 directement soit un syst\u00e8me d&#8217;exploitation. Les 2 kilo-octets du moniteur en haut de la m\u00e9moire ne forment pas un syst\u00e8me en soit. C&#8217;est un programme dans lequel on peut entrer pour op\u00e9rer et debugger la machine. Mais cette partie n&#8217;est pas construite comme un syst\u00e8me dont on pourrait appeler des fonctions pr\u00e9d\u00e9finies. En fait, cette ROM moniteur pourrait \u00eatre tout aussi bien remplac\u00e9e par de la RAM. Particularit\u00e9s du programme de boot Ce programme, tr\u00e8s court (199 octets utiles), utilise les deux cartes Pile\/Canal. L&#8217;une d&#8217;elles est utilis\u00e9e comme m\u00e9moire secondaire sous forme de pile. En effet, le 8008 n&#8217;a pas de gestion de pile en RAM comme on peut en trouver sur le Z80. Ce processeur n&#8217;a qu&#8217;une toute petite pile d&#8217;adresses, interne et non accessible, qui servent aux appels de sous-routines. Cette carte de m\u00e9moire secondaire sert pour calculer la somme de contr\u00f4le des donn\u00e9es lues depuis la disquette, sans avoir besoin de la RAM, qui est en train d&#8217;\u00eatre remplie par ces dites donn\u00e9es. Cela nous apprend donc que pour \u00e9crire dans cette pile, il faut utiliser l&#8217;instruction `OUT $16` (envoyer sur le port de sortie num\u00e9ro $16 en hexad\u00e9cimal). Pour lire depuis la pile, il faut utiliser l&#8217;instruction `INP $6` (lire depuis le porte d&#8217;entr\u00e9e num\u00e9ro 6). L&#8217;autre carte sert de buffer de lecture. Le programme y place le nombre d&#8217;octets attendus, puis demande au contr\u00f4leur de disquette de lancer la lecture. Une fois le nombre [&hellip;]","og_url":"https:\/\/mo5.com\/en\/programmer-le-micral-n\/","og_site_name":"MO5.COM","article_publisher":"https:\/\/www.facebook.com\/pages\/Association-MO5COM\/9540357570","article_published_time":"2023-05-03T12:00:43+00:00","article_modified_time":"2023-05-03T12:45:55+00:00","og_image":[{"width":474,"height":268,"url":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif","type":"image\/gif"}],"author":"Sylvain Glaize","twitter_card":"summary_large_image","twitter_creator":"@assomo5","twitter_site":"@assomo5","twitter_misc":{"Written by":"Sylvain Glaize","Estimated reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#article","isPartOf":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/"},"author":{"name":"Sylvain Glaize","@id":"https:\/\/mo5.com\/#\/schema\/person\/e2593639b2e77eace001e56b26086749"},"headline":"Programmer le Micral N","datePublished":"2023-05-03T12:00:43+00:00","dateModified":"2023-05-03T12:45:55+00:00","mainEntityOfPage":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/"},"wordCount":1637,"publisher":{"@id":"https:\/\/mo5.com\/#organization"},"image":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#primaryimage"},"thumbnailUrl":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif","articleSection":["Micral","Programmation"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/mo5.com\/programmer-le-micral-n\/","url":"https:\/\/mo5.com\/programmer-le-micral-n\/","name":"Programming the Micral N - MO5.COM","isPartOf":{"@id":"https:\/\/mo5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#primaryimage"},"image":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#primaryimage"},"thumbnailUrl":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif","datePublished":"2023-05-03T12:00:43+00:00","dateModified":"2023-05-03T12:45:55+00:00","breadcrumb":{"@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mo5.com\/programmer-le-micral-n\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#primaryimage","url":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif","contentUrl":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/05\/20230501-MicralN-Emulation-Panel-Chenillard.gif","width":474,"height":268,"caption":"Chenillard en action sur l'\u00e9mulateur Micral N"},{"@type":"BreadcrumbList","@id":"https:\/\/mo5.com\/programmer-le-micral-n\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/mo5.com\/"},{"@type":"ListItem","position":2,"name":"Programmer le Micral N"}]},{"@type":"WebSite","@id":"https:\/\/mo5.com\/#website","url":"https:\/\/mo5.com\/","name":"MO5.COM","description":"Preserve, explore, replay","publisher":{"@id":"https:\/\/mo5.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mo5.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/mo5.com\/#organization","name":"MO5.COM Association","url":"https:\/\/mo5.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/mo5.com\/#\/schema\/logo\/image\/","url":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/10\/Logo_MO5_A_Colo_Texte_Bleu-e1697059504554.png","contentUrl":"https:\/\/mo5.com\/wp-content\/uploads\/2023\/10\/Logo_MO5_A_Colo_Texte_Bleu-e1697059504554.png","width":2094,"height":559,"caption":"Association MO5.COM"},"image":{"@id":"https:\/\/mo5.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pages\/Association-MO5COM\/9540357570","https:\/\/x.com\/assomo5","http:\/\/www.instagram.com\/assomo5","https:\/\/www.youtube.com\/channel\/UCRncMsBo89C9u_8gpWnsOVw\/featured","https:\/\/bsky.app\/profile\/assomo5.bsky.social","https:\/\/twitch.tv\/mo5assoretro"]},{"@type":"Person","@id":"https:\/\/mo5.com\/#\/schema\/person\/e2593639b2e77eace001e56b26086749","name":"Sylvain Glaize","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c57fffe6046f79130765edc0cc15c31865aef60892197deca86f5c61d3f2261b?s=96&d=mm&r=g","caption":"Sylvain Glaize"},"url":"http:\/\/mo5.com\/en\/author\/mokona78\/"}]}},"_links":{"self":[{"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/posts\/645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/users\/329"}],"replies":[{"embeddable":true,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/comments?post=645"}],"version-history":[{"count":0,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/posts\/645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/media\/20658"}],"wp:attachment":[{"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/media?parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/categories?post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mo5.com\/en\/wp-json\/wp\/v2\/tags?post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}