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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education