Simulate a simple guessing game

Assignment Help Assembly Language
Reference no: EM132191652

Description:
LC3 allows input from keyboard and output to display on the screen. This lab will exercise the input/output capability using LC-3 Assembly language.

Procedure:

1. Your program will simulate a simple guessing game. The program has stored the value 6. The program will continually ask the user to guess a number between 0 and 9 (see sample program input/output below.) The user enters the guess from the keyboard:
- If the guess is larger than 6; the program should output: Too big.
- If the guess is smaller than 6; the program should output: Too small.
- When the user finally guesses correctly, the program will output: Correct! You took # guesses.
- If after 9 guesses, the user has not correctly guessed the number, the program should output: Game over. Correct answer is 6.

2. You do not need to process any invalid input (alphabetical characters, punctuation, etc). If your program encounters any non digit character, the program should output (Invalid input should still count as a guess): Invalid input.

3. When using the LC-3 simulator to test your programs, you should manually load test values into these memory locations before running your program.

4. LC-3 has a set of trap vectors (See slide #10 of Lecture 7 or see Table A.3 in Appendix A of the textbook for details).
- You should use TRAP x20 (GETC), to read in a character from the keyboard.
- Followed by the instruction TRAP x21 (OUT), the character will be displayed on the screen.
- The instruction TRAP x22 (PUTS) will display null-terminated string on the screen.

5. All input and output functions use ASCII characters. You are responsible for making any conversions that are necessary.
- The ASCII code x0A causes the cursor to go to the next line (Newline).

Notes and Suggestions:
- The first line of your programs must specify the memory address of the first instruction of your program. LC-3 simulator will place your program starting at that address. For this assignment, you should place your program starting at x3000.
- Before sitting down at the computer, give some serious thought to what this program involves. Break it into sections. You might even want to draw a simple flow chart.
- Comment your code! Not only does this help you debug your program, but it will make it easier to remember what you did, should you need to look back at your code for future projects (hint, hint).

Reference no: EM132191652

Questions Cloud

Discuss the difference in medicare payment methods : Question - Discuss the difference in Medicare payment methods for outpatient services and physician services
Building supply store that sells wide range of products : Assume the role of a manager of a home improvements/building supply store that sells a wide range of products—including lumber, plumbing xtures,
Discuss exercises that require the elbow flexors : Envision a hypothetical event in which an individual comes to you to discuss exercises that require the elbow flexors and extensors
Strengths and weaknesses of the radiation therapy : Design a chart that details the strengths and weaknesses of the three major cancer treatments; radiation therapy, surgery and chemotherapy
Simulate a simple guessing game : CPS2390 Computer Organization and Architecture - simulator to test your programs, you should manually load test values into these memory locations
Examine at least three examples of quality initiatives : Examine at least three (3) examples of quality initiatives that could increase patient satisfaction and potentially reduce healthcare cost
Compare and contrast between bluetooth and nfc : Compare and contrast between Bluetooth and NFC. Please, also, do we really need both? And why Can't Bluetooth accomplish the functions of NFC?
Ineffectual reporting and disclosure requirements : Other than the mandates of the Internal Revenue Code (IRC) and a few other ineffectual reporting and disclosure requirements,
Why is it advantageous to have baroreceptors in aortic arch : Why is it advantageous to have baroreceptors in the aortic arch and carotid sinus rather than in some other location

Reviews

len2191652

12/12/2018 1:42:32 AM

Lab report: • You should do the programming assignment by yourself. • Your report should include all information required to be noted in the procedure, any problems/issues you encountered during the lab and how did you resolve them. • Grading: 80% for correct values; 15% for commenting; 5% for technique

Write a Review

Assembly Language Questions & Answers

  Write a program that displays a single character

Description: Write a program that displays a single character at 100 random screen locations, with a delay factor of 100 milliseconds.Hint: set the console window screen height to 200 at runtime, and watch the scroll bar jump up and down.

  Write an assembly language program that has two subroutines

write an assembly language program that has two subroutines one for encrypting alphabates of a string and second fo

  Write a constant declaration named arraysize

Given the following array definition, write a constant declaration named ArraySize that automatically calculates the size in bytes, of the array

  Write a function to convert a given function

Write a function to convert a given function from infix to postfix in assembly. The basic structure of the function is given in the attached assembly language file.

  Write a complete well documented assembly language

write a complete well documented assembly language program (starts at $C000) that counts the number of 1s in each byte in a list. The LIST_IN starts at $C100 and it has 12 bytes ( create your own random bytes for the list). The results (count of 1s) ..

  Prepare a assembly program of given code

Please submit assembly program-This program is supposed to set R0 = 1 if there a 5 in one of ten memory locations, starting at x3100. Else it should set R0 to 0

  Write a mips assembly program that can search for a number

Write a MIPS assembly program that can search for a number that is entered by a user in an array with 20 integer number.

  Write lock and unlock in assembly language

If all processes lock the semaphore table before using it, only one process at a time can fiddle with the variables and pointers, thus preventing races. Write lock and unlock in assembly language.

  Write a mips assembly language program

write a MIPS assembly language program that can be loaded and executed using the MARS simulator.

  Program that ask the user to input a number between 0-10

Write a program that ask the user to input a number between 0-10 (n). Then your program finds the factorial of the number

  Write a mips assembly language program

Write a MIPS assembly language program to find the largest number among N 32-bit signed numbers, each represented in the 2's complement number system.

  Bios interrupt int 21 to read current system time

Write a program in assembly language which uses BIOS interrupt INT 21 to read current system time and displays it on the top-left corner of the screen.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd