IN LC-3. Modify the code to satisfy the Description of Code Description of Code: ;  Reads two (2) values from Memory, displays message about status of first (startVal) ;  Add both values, display message about status of added values,  ;  and stores added value to Memory. Requirements: Reads two (2) values from Memory Displays message about status of first (startVal) Add both values Display message about status of added values Stores added value to Memory Do not modify outside of the ";;;;;Your Code Here" block Suggested Test Data:  startVal :  5, addThis: -6, Was output: "Value was Positive", Is output: "Value is Negative". Result contains -1 startVal : -5, addThis: -6, Was output: "Value was Negative", Is output: "Value is Negative". Result contains -11 startVal : -5, addThis:  5, Was output: "Value was Negative", Is output: "Value is Zero". Result contains 0 startVal :  0, addThis:   0, Was output: "Value was Zero", Is output: "Value is Zero". Result contains 0   Hints: R0 is a 'reserved' register when printing strings to the console. Don't overwrite your data when trying to print to the console The 'was' and 'is' parts of this assignment are very similar. Spend most of your time creating the 'was' section. Then copy, paste, and modify the 'is' section After making sure the 'was' section works, use the Set Breakpoint feature of the debugging tools to jump past all that when working in the 'is' section. Code: .ORIG x3000 ;;;;; Your code here ;;;;; End of your code      Done    HALT ;End of Program ;Data Declarations-------------    startVal .FILL #5 ;*** Starting value    addThis .FILL #-6   ;*** Value to add    Result .BLKW 1       ;*** Memory location to store new value    ;*** Output Message options for startVal's inital status    WasPos    .STRINGZ "Value was Positive, "    WasNeg    .STRINGZ "Value was Negative, "    WasZero    .STRINGZ "Value was Zero, "    ;*** Output Message options for added value's status    IsPos    .STRINGZ "Value is now Positive"    IsNeg    .STRINGZ "Value is now Negative"    IsZero    .STRINGZ "Value is now Zero" .END

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

IN LC-3. Modify the code to satisfy the Description of Code
Description of Code:
;  Reads two (2) values from Memory, displays message about status of first (startVal)
;  Add both values, display message about status of added values, 
;  and stores added value to Memory.

Requirements:

  1. Reads two (2) values from Memory
  2. Displays message about status of first (startVal)
  3. Add both values
  4. Display message about status of added values
  5. Stores added value to Memory
  6. Do not modify outside of the ";;;;;Your Code Here" block

Suggested Test Data: 

  • startVal :  5, addThis: -6, Was output: "Value was Positive", Is output: "Value is Negative". Result contains -1
  • startVal : -5, addThis: -6, Was output: "Value was Negative", Is output: "Value is Negative". Result contains -11
  • startVal : -5, addThis:  5, Was output: "Value was Negative", Is output: "Value is Zero". Result contains 0
  • startVal :  0, addThis:   0, Was output: "Value was Zero", Is output: "Value is Zero". Result contains 0

 

Hints:

R0 is a 'reserved' register when printing strings to the console. Don't overwrite your data when trying to print to the console

The 'was' and 'is' parts of this assignment are very similar. Spend most of your time creating the 'was' section. Then copy, paste, and modify the 'is' section

After making sure the 'was' section works, use the Set Breakpoint feature of the debugging tools to jump past all that when working in the 'is' section.

Code:

.ORIG x3000
;;;;; Your code here


;;;;; End of your code
   

 Done    HALT

;End of Program

;Data Declarations-------------
   startVal .FILL #5 ;*** Starting value
   addThis .FILL #-6   ;*** Value to add
   Result .BLKW 1       ;*** Memory location to store new value

   ;*** Output Message options for startVal's inital status
   WasPos    .STRINGZ "Value was Positive, "
   WasNeg    .STRINGZ "Value was Negative, "
   WasZero    .STRINGZ "Value was Zero, "

   ;*** Output Message options for added value's status
   IsPos    .STRINGZ "Value is now Positive"
   IsNeg    .STRINGZ "Value is now Negative"
   IsZero    .STRINGZ "Value is now Zero"

.END



Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning