{"id":1440,"date":"2015-05-12T13:49:36","date_gmt":"2015-05-12T20:49:36","guid":{"rendered":"http:\/\/sites.evergreen.edu\/compcog15\/?page_id=1440"},"modified":"2015-05-12T13:49:36","modified_gmt":"2015-05-12T20:49:36","slug":"assembly-language-assignment","status":"publish","type":"page","link":"https:\/\/sites.evergreen.edu\/compcog17\/assembly-language-assignment\/","title":{"rendered":"Assembly Language Assignment"},"content":{"rendered":"<header class=\"entry-header\">\n<h1 class=\"entry-title\">Assembly Language Assignment<\/h1>\n<\/header>\n<div class=\"entry-content\">\n<h1><a href=\"http:\/\/balance3e.com\/Ch14\/instructions.html\">Machine Language Description:<\/a><\/h1>\n<p><a href=\"http:\/\/balance3e.com\/Ch14\/machine.html\">Machine Language Computer Simulator<\/a><\/p>\n<h1><strong>Assembly Language Assignment \u00a0Put the 2 numbers you want added into memory location 7 and 8. \u00a0This code will add them together and store the result in loc #9<br \/>\nBasic Add code:<br \/>\nLoad r0 7<br \/>\nLoad r1 8<br \/>\nAdd r2 r0 r1<br \/>\nStore 9 r2<br \/>\nHalt<\/strong><\/h1>\n<h1><strong><br \/>\nChallenge:<br \/>\nadd 3 numbers, the one stored in memory location 6, 7, and 8.<br \/>\nStore answer in location 9<\/strong><\/h1>\n<h1><strong><br \/>\nBranching Example: Add all the numbers between 1 and ???<br \/>\nPut a 1 in location 10 and a 0 in locations 11 and 12.<br \/>\nLocation 10 will be the amount you count by<br \/>\nLocation 11 will be the total sum<br \/>\nLocation 12 will be the next number to add:<\/strong><\/h1>\n<h1><strong>LOAD R3 10<\/strong><br \/>\n<strong>LOAD R0 11<\/strong><br \/>\n<strong>LOAD R1 12<\/strong><br \/>\n<strong>ADD R2 R0 R1<\/strong><br \/>\n<strong>STORE 11 R2<\/strong><br \/>\n<strong>ADD R1 R1 R3<\/strong><br \/>\n<strong>STORE 12 R1<\/strong><br \/>\n<strong>BRANCH 1<\/strong><\/h1>\n<h1><strong>Teaching the computer to multiply<\/strong><br \/>\n<strong>Put 1 in location 31, used for decrementing<\/strong><br \/>\n<strong>Put one number to multiply in location 30<\/strong><br \/>\n<strong>Put the other number to multiply in location 29<\/strong><\/h1>\n<h1><strong>Enter the folowing code:<\/strong><\/h1>\n<h1><strong>Load r0 29<\/strong><br \/>\n<strong>Add r2 r0 r2<\/strong><br \/>\n<strong>Load r0 30<\/strong><br \/>\n<strong>Load r1 31<\/strong><br \/>\n<strong>Sub r3 r0 r1<\/strong><br \/>\n<strong>Bzero 10<\/strong><br \/>\n<strong>Store 30 r3<\/strong><br \/>\n<strong>Load r0 29<\/strong><br \/>\n<strong>Add r2 r0 r2<\/strong><br \/>\n<strong>Branch 2<\/strong><br \/>\n<strong>Store 28 r2<\/strong><br \/>\n<strong>Halt<\/strong><\/h1>\n<h1><strong>XC Assignment: Teach the computer to divide:<\/strong><br \/>\n<strong>Put the larger number in 29 and the smaller in 30. Only use numbers where 30 \u00a0divides evenly into 29.<\/strong><\/h1>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Assembly Language Assignment Machine Language Description: Machine Language Computer Simulator Assembly Language Assignment \u00a0Put the 2 numbers you want added into memory location 7 and 8. \u00a0This code will add them together and store the result in loc #9 Basic Add code: Load r0 7 Load r1 8 Add r2 r0 r1 Store 9 r2 [&hellip;]<\/p>\n","protected":false},"author":274,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"_mi_skip_tracking":false},"_links":{"self":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/1440"}],"collection":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/users\/274"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/comments?post=1440"}],"version-history":[{"count":0,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/1440\/revisions"}],"wp:attachment":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/media?parent=1440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}