Question
Assembly Program that will: Load program at x3000 Prompt for Number (1 9) Output : negative of that number Example: Please input a number from
Assembly Program that will:
Load program at x3000
Prompt for Number (1 9)
Output: negative of that number
Example:
Please input a number from 1 9:
>> 5 (User inputs a 5)
Negative value: -5
this needs to be written in lc3
; coRY WINDHAM 2810-001
; THIS PROGRAM PROMPTS USER FR NUMBER 1-9 THEN FLIPS THAT INPUT NEGATIVE
.ORIG X3000
; intro string and instructions
LEA R0, INTRO1
PUTS
LEA R0, INTRO2
PUTS
; get user input
IN ; get user input
;output value
LEA R0, OUTPUT
PUTS
HALT
INTRO1 .STRINGZ "THIS PROGRAM TAKES YOUR NUMBER AND MAKES IT NEGATOVE. "
INTRO2 .STRINGZ "PLEASE ENTER A NUMBER BETWEEN 1 AND 9. "
OUTPUT .STRINGZ "NEGATIVE VALUE"
.END
this is what I have
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started