{"id":68663,"date":"2021-10-31T20:21:24","date_gmt":"2021-10-31T20:21:24","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/10\/31\/assembly-language-question\/"},"modified":"2021-10-31T20:21:24","modified_gmt":"2021-10-31T20:21:24","slug":"assembly-language-question","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/10\/31\/assembly-language-question\/","title":{"rendered":"Assembly Language Question"},"content":{"rendered":"<p>Here is the assignment. If you have any questions or if you need anything, please let me know. I need it to be done with the extra credit. Thank you. <br \/>Write an LC-3 assembly language program that counts the number of 1s in the value stored in R0 and stores the result in R1. For example, if R0 contains 0001001101110000 (x1370), then after the program executes, the value stored in R1 would be 0000000000000110 (decimal 6) <br \/>Here are some hints from my solution: <br \/>ORIG x3000 <br \/>AND R5, R5, #0 <br \/>ADD R5, R5, #1 ;R5 will act as a mask <br \/>AND R1, R1, #0 ;zero out the result register <br \/>AND R2, R2, #0 ;R2 will act as a counter <br \/>LD R3, NegSixt <br \/>MskLoop AND R4, R0, R5 ;mask off the bit <br \/>Add code here&#8230; if you want more than a 0 \ud83d\ude09 <br \/>EXTRA CREDIT <br \/>Solicit the number to be inspected via the keyboard. <br \/>10 points for a single digit (e.g. 5) decimal number, which must be converted to binary. <br \/>20 points for a two digit (e.g. 55) decimal number, which must be converted to binary. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is the assignment. If you have any questions or if you need anything, please let me know. I need it to be done with the extra credit. Thank you. Write an LC-3 assembly language program that counts the number of 1s in the value stored in R0 and stores the result in R1. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-68663","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/68663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=68663"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/68663\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=68663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=68663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=68663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}