To Learn How to Program in the LC-3 Assembly Language, Including

To Learn How to Program in the LC-3 Assembly Language, Including

<p>CSC 225 Assignment #3 – igPay atinLay Notes:</p><p>You may work with a partner! Turn in one cover page, do one demo, and submit one version of code to handin.</p><p>Objectives:</p><p>To learn how to program in the LC-3 assembly language, including:  assembly language instructions  psuedo-ops  traps  basic I/O</p><p>Background:</p><p>Your program will translate words from English to Pig Latin. To translate to Pig Latin, remove the starting letter of the word and put it at the end. Then add "ay" to the word. Some sample translatons:</p><p>Julie translates to ulieJay</p><p>Paul translates to aulPay</p><p> binary translates to inarybay</p><p>Extra Credit (2 points):</p><p>A proper Pig Latin translator would check to see if the word started with a vowel and simply append "way" to the end without removing anything from the front. You may earn 2 points extra credit if you implement this. You only have to handle lowercase letters. Sample translation:</p><p> otay translates to otayway</p><p>You can do this any way that you want, but it’s MUCH cooler if you can do it in a loop, rather than by checking each vowel one by one with separate code.</p><p>Description:</p><p>Input: </p><p>Your program should prompt the user for the word to be translated. Please read the following requirements and hints carefully.</p><p> The user is to input a word of no more than 19 characters, followed by the <enter> key. Assume the user will not enter a message longer than 19 characters. Checking for too many characters is NOT necessary.</p><p> Store the word one character per location in memory. You must store the word.</p><p> Your program may allocate room to store 20 characters, including the <enter> key. Do not allot space for more than 20 characters in memory.</p><p> Hint #1: Using a TRAP x20 (GETC) followed by a TRAP x20 (OUT) will get keystrokes and echo them back to the console.</p><p> Hint #2: The <enter> key is ASCII x0A or ASCII x0D. (It is different on the Windows and Linux machines. Check to see which one your machine uses.)</p><p> Hint #3: For reasons that will become clear to you later, do not use R7 to store anything for this assignment.</p><p>Translation Algorithm: </p><p>1. Remove (do not print) the first letter of the word and put (print) it at the end of the word. 2. Add "ay" to the word.</p><p>Output:</p><p> You must print prompts for the English word and Pig-Latin word (see below).</p><p> The translated word should be output to the screen and does not need to be stored.</p><p> After outputting the translated word to the screen, the program should prompt the user again, creating an endless loop.</p><p> Your program should then output the translated word to the screen. Following is a sample run of the program (input shown in bold for clarity only):</p><p>English Word: Paul Pig-Latin Word: aulPay English Word: Hatalsky Pig-Latin Word: atalskyHay</p><p> Your input/output format should match the above example.</p><p>Code Format:</p><p>Your code should be a single text file of LC-3 assembly code. </p><p> Comment your code. There should be a header block at the top with your name and a description of the program. Include a description of what you use each register for. Then comment “blocks” of code underneath. You do not need to comment every line.</p><p>Other Information:</p><p> Your program should start at memory location x3000.</p><p> Name your assembly file pigLatin.asm. Assemble it using the 'asm' button in the LC-3 Editor</p><p> Your program must loop and run correctly multiple times in a row. Testing</p><p>Test your program thoroughly. Duh.</p><p>Demo</p><p>Demo your program to your instructor.</p><p>Handin</p><p>Handin by the end of lab on the day it is due. You may handin early and then simply re- handin if you need to make changes to your code. You must handin to your section. Replace the XX with your section number. Handin will CLOSE at the end of lab.</p><p> handin grader-ph 225-XX-asgn3 pigLatin.asm</p><p>Deliverable</p><p>Cover page with Demo Signature</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us