Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Start your programs at x 3 0 0 0 . Make sure to comment each line of code in the case of machine code

Instructions
Start your programs at x3000.
Make sure to comment each line of code in the case of machine code and have
adequate comments in case of assembly code. Use the four-column model for assembly code
1. Write a machine code program for the LC3. It should print out the letters: AZBYCXDWEVFUGTHSIRJQKPLOMN That is, print all 26 letters of the English alphabet alternating letters in ascending order, starting at A, with letters in descending order, starting with Z. Your program must use loop(s).
2. Write an assembly language program to simulate a simple guessing game. The program has stored the value n(n is a number between 0 and 9, inclusive). The program will continually ask the user to guess a number between 0 and 9(see sample
program input/output below). If your program encounters any non-digit character, the
program should output Invalid input. Invalid input should still count as a guess. You can use
in your strings (.STRINGZ) to make the prompt start on a newline. Assume that the user guesses correctly within 9 guesses.
Your program is required to include a line of code like the following:
Number .FILL #7 ; The number to guess
The line of code above should allow the user to succeed when they enter '7'.If I edit your program during grading and change 'n' to another value in the range 0 to 9,then your program should behave appropriately with the new value.
Sample Output
Guess a number from 0 to 9: 3
Your guess was too low.
Guess again: 9
Your guess was too high.
Guess again: a
Invalid input.
Guess again: 7
Correct! You took 4 guesses.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions