Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create LC-3 assembly language program will interpret keystrokes as commands for printing characters on the console, resulting in ASCII art -- the ability to draw

Create LC-3 assembly language program will interpret keystrokes as commands for printing characters on the console, resulting in ASCII art -- the ability to draw pictures using ASCII characters.

For example, if the user types the following, where is used to represent Enter (linefeed):

3*3 3* 1 3*1 3* 2 5* 3 3* 4 1* X

it means: 3 stars, 3 spaces, 3 stars, next line. 1 space, 3 stars, 1 space, 3 stars, next line. 2 spaces, 5 stars, next line. 3 spaces, 3 stars, next line. 4 spaces, 1 star, next line. Stop.

Details

The program must start at address x3000. Heres how the program must behave:

1. The program waits for a character to be typed on the keyboard. (Use GETC to read the character; it will be placed in R0.)

2. If the character is a digit (0 through 9):

a)Convert the character to its corresponding decimal value. In other words, 0 becomes zero, 1 becomes 1, ... 9 becomes 9. Lets call that value R (for run length).

b)Wait for another character (using GETC).

c)Print R copies of that character to the console. (Use OUT to print one character, and do this R times. The character to be printed must be in R0 when OUT is called.)

d)Go back to Step 1.

3. Else, if the character is Enter/Return (ASCII #10): Print a linefeed (ASCII #10) to the console, and go back to Step 1.

4. Else, if the character is anything else, halt the program. (Use HALT.)

This is the basic logic and design class. If anyone could help me out so I can see where I am going wrong, that would be amazing.

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago