{"id":2668,"date":"2018-02-05T22:05:25","date_gmt":"2018-02-05T22:05:25","guid":{"rendered":"https:\/\/old.staging-teachcomputerscienceuk.kinsta.cloud\/?p=1356"},"modified":"2024-07-24T11:11:20","modified_gmt":"2024-07-24T11:11:20","slug":"lmc-load-and-save","status":"publish","type":"post","link":"https:\/\/teachcomputerscience.com\/lmc-load-and-save\/","title":{"rendered":"LMC Load and Save"},"content":{"rendered":"<div class=\"gb-container gb-container-e969661a upsell-block\"><div class=\"gb-inside-container\">\n<div class=\"gb-grid-wrapper gb-grid-wrapper-7be452a8\">\n<div class=\"gb-grid-column gb-grid-column-b80733ef\"><div class=\"gb-container gb-container-b80733ef\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-51b35e8e gb-headline-text\">GCSE Programming Resources (14-16 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-e0423ebf\">\n\n<a class=\"gb-button gb-button-93f56566 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/gcse\/programming\/\">View GCSE Programming Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n\n<div class=\"gb-grid-column gb-grid-column-e6f4d2ed\"><div class=\"gb-container gb-container-e6f4d2ed\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-3b2a480b gb-headline-text\">A-Level Software Resources (16-18 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-56da02af\">\n\n<a class=\"gb-button gb-button-3fe0b30f gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/a-level\/software\/\">View A-Level Software Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n\n<p>The following program will demonstrate the use of LDA and STA, the Load and Save instructions used in the LMC.<br>Running the program: when prompted, INPUT a set of two numbers. The program should then OUTPUT them in the same order that they were entered.<\/p>\n\n\n\n<figure class=\"wp-block-table rcp-table\"><table><tbody><tr><td>INP<br><strong>STA<\/strong> <span class=\"style6\">first<\/span><br>INP<br><strong>STA<\/strong> <span class=\"style9\">second<\/span><br><strong>LDA<\/strong> <span class=\"style6\">first<\/span><br>OUT<br><strong>LDA<\/strong> <span class=\"style9\">second<\/span><br>OUT<br>HLT<br><span class=\"style6\">first<\/span> DAT<br><span class=\"style9\">second<\/span> DAT<\/td><td>0 INP<br>1 <strong>STA<\/strong> <span class=\"style6\">9<\/span><br>2 INP<br>3 <strong>STA<\/strong> <span class=\"style9\">10<\/span><br>4 <strong>LDA<\/strong> <span class=\"style6\">9<\/span><br>5 OUT<br>6 <strong>LDA<\/strong> <span class=\"style9\">10<\/span><br>7 OUT<br>8 HLT<br><span class=\"style6\">9<\/span> DAT 0<br><span class=\"style9\">10<\/span> DAT 0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Instructions<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Copy the eleven line program above and paste it into the Program box.<\/li><li>Click on the &#8220;Assemble Program&#8221; button.<\/li><li><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-393 size-full\" src=\"http:\/\/teachcomputerscience.com\/wp-content\/uploads\/2016\/12\/img6E.gif\" alt=\"Image\" width=\"372\" height=\"47\" title=\"\">After the program is assembled you should see RAM addresses 0 to 8 contain the machine code instructions shown in the image.<\/li><li>Click on the RUN button.<\/li><li>If you have difficulty following what is happening, read the explanation below and use STEP instead of RUN so you can follow each step.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation<\/h3>\n\n\n\n<p><strong>first<\/strong> and <strong>second<\/strong> are used to label a <strong>DAT<\/strong> instruction. DAT identifies the 10th and 11th instructions as data. The labels therefore refer to RAM addresses 9 and 10 respectively (0-indexed counting).<br><\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"language-clike\"><p>0 INP \/\/the first input value is copied into the accumulator.<br \/>\n1 STA first \/\/the accumulator contents are stored in RAM address 9 (labelled<br \/>\nfirst).<br \/>\n2 INP \/\/the second input value is copied into the accumulator.<br \/>\n3 STA second \/\/the accumulator contents are stored in RAM address 10 (labelled<br \/>\nsecond).<br \/>\n4 LDA first \/\/the contents of memory address 9 (labelled first) are loaded into<br \/>\nthe accumulator.<br \/>\n5 OUT \/\/the value in the accumulator is sent to the OUTPUT.<br \/>\n6 LDA second \/\/the contents of memory address 10 (labelled second) are loaded into<br \/>\nthe accumulator.<br \/>\n7 OUT \/\/the value in the accumulator is sent to the OUTPUT.<br \/>\n8 HLT \/\/the program halts.<\/p>\n<\/code><\/pre><div class=\"code-meta\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Example results<\/h3>\n\n\n\n<p>INPUT= 2, 3<br>OUTPUT = 2, 3<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-8ec5391b gb-headline-text\">Further Readings:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Little_man_computer\" target=\"_blank\" rel=\"noopener\">Little man computer<\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/028-desktop-1.png\" alt=\"The following program will demonstrate the use of LMC Load and Save\" class=\"wp-image-5961\" width=\"275\" height=\"275\" title=\"\" srcset=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/028-desktop-1.png 512w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/028-desktop-1-150x150.png 150w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/028-desktop-1-300x300.png 300w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The following program will demonstrate the use of LDA and STA, the Load and Save instructions used in the LMC.Running the program: when prompted, INPUT a set of two numbers. The program should then OUTPUT them in the same order that they were entered. INPSTA firstINPSTA secondLDA firstOUTLDA secondOUTHLTfirst DATsecond DAT 0 INP1 STA 92 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"LMC Load and Save\" class=\"read-more button\" href=\"https:\/\/teachcomputerscience.com\/lmc-load-and-save\/\" aria-label=\"More on LMC Load and Save\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_generate-full-width-content":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16],"tags":[204,47],"class_list":["post-2668","post","type-post","status-publish","format-standard","hentry","category-lmc","tag-article","tag-hide-old-upsell","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/comments?post=2668"}],"version-history":[{"count":2,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2668\/revisions"}],"predecessor-version":[{"id":607051,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2668\/revisions\/607051"}],"wp:attachment":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/media?parent=2668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/categories?post=2668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/tags?post=2668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}