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

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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