{"id":7402,"date":"2023-03-03T06:44:47","date_gmt":"2023-03-03T06:44:47","guid":{"rendered":"https:\/\/www.goodacademic.com\/blog\/questions\/make-a-program-in-assembly-language\/"},"modified":"2023-03-03T06:44:47","modified_gmt":"2023-03-03T06:44:47","slug":"make-a-program-in-assembly-language","status":"publish","type":"questions","link":"https:\/\/www.goodacademic.com\/blog\/questions\/make-a-program-in-assembly-language\/","title":{"rendered":"Make a program in Assembly language"},"content":{"rendered":"<div class=\"col-sm-12 messageContent\">\n <b>Learning Goal: <\/b>I&#8217;m working on a programming writing question and need the explanation and answer to help me learn.<\/p>\n<p><strong>Be sure to modify the variables with YOUR First and Last names!<\/strong><\/p>\n<p>This is a take-home Lab. You <i>should<\/i> be able to do this with your RaspberryPi as discussed. However, you may also use the IoT Lab in ERB to connect to your Pi and do this assignment.<\/p>\n<p>This is an individual assignment.<\/p>\n<p>You will be required to provide <strong>READABLE<\/strong> screen captures in a PDF file.<\/p>\n<p>You will be using the gdb debugger to pause your program at specific places in your program. We have discussed how to do this in class multiple times.<\/p>\n<p>You will use my c code below to create a function in ARM assembly that will concatenate your first name and last name into a single string based on the definition of the external function \u00e2\u20ac\u02dcstrCat\u00e2\u20ac\u2122.<\/p>\n<pre>\/\/ CSE 2312 Computer Org and Assembly Language Programming<br><br>\/\/ strings concatenate<br><br>\/\/ YOUR NAME<br><br><br><br><br>#include &lt;stdlib.h&gt; \/\/ EXIT_ macro<br><br>#include &lt;stdio.h&gt; \/\/ printf<br><br>#include &lt;inttypes.h&gt; \/\/ PRI macro<br><br>#include &lt;stdint.h&gt; \/\/ C99 uintX_t and intX_t types<br><br><br><br><br>extern void strCat(const char first[], const char last[]);<br><br><br><br><br>int main(void)<br><br>{<br><br>char last[] = \"Lastname\";<br><br>char str[] = \"Hello World!\";<br><br>char first[30] = \"Firstname \"; \/\/ <strong>with a \u00e2\u20ac\u02dcspace\u00e2\u20ac\u2122 at the end<\/strong><br><br>strCat(first, last);<br><br>printf(\"Full Name = %s\\n\", first);<br><br>return EXIT_SUCCESS;<br><br>}<\/pre>\n<ol>\n<li>You will place a breakpoint where strCat is called.<\/li>\n<li>You will \u00e2\u20ac\u02dcstep\u00e2\u20ac\u2122 into the assembly function.<\/li>\n<li>You will need to list your assembly function to find the BX LR line.<\/li>\n<li>You will place a breakpoint at the BX LR line.<\/li>\n<li>DO NOT Continue Yet!<\/li>\n<li>You must use the debugger to display the memory location of the string \u00e2\u20ac\u0153first\u00e2\u20ac\ufffd<\/li>\n<li>the command is:x\/64cb $r#<\/li>\n<li>Replace the # with the correct register number, note the first address printed, you will need this later.<\/li>\n<li>Now \u00e2\u20ac\u02dccontinue\u00e2\u20ac\u2122 the program.<\/li>\n<li>When it pauses at BX LR, you will need to display the memory as before, but replace \u00e2\u20ac\u02dc$r#\u00e2\u20ac\u2122 with the address noted earlier.<\/li>\n<li>Now \u00e2\u20ac\u02dccontinue\u00e2\u20ac\u2122 again.<\/li>\n<li>The program should now be complete and c should have printed the full name.<\/li>\n<li>Take a screenshot of the window showing all the debugger output.<\/li>\n<li><strong>You may have to repeat the process flawlessly to get all the data on one screen<\/strong><\/li>\n<li>You will also provide a screenshot of the assembly code. Y<strong>our name must be in a comment at the top of the file.<\/strong><\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Learning Goal: I&#8217;m working on a programming writing question and need the explanation and answer to help me learn. Be sure to modify the variables with YOUR First and Last names! This is a take-home Lab. You should be able to do this with your RaspberryPi as discussed. However, you may also use the IoT [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"disciplines":[732],"paper_types":[],"tagged":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions\/7402"}],"collection":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions"}],"about":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/types\/questions"}],"author":[{"embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/comments?post=7402"}],"version-history":[{"count":0,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/questions\/7402\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/media?parent=7402"}],"wp:term":[{"taxonomy":"disciplines","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/disciplines?post=7402"},{"taxonomy":"paper_types","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/paper_types?post=7402"},{"taxonomy":"tagged","embeddable":true,"href":"https:\/\/www.goodacademic.com\/blog\/wp-json\/wp\/v2\/tagged?post=7402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}