Concept explainers
Explanation of Solution
Subroutine to subtract two numbers:
The following code is to subtract two numbers with formal parameters “X” and “Y”. The input of the
The hexadecimal address starts with “100” in instruction.
100 Load A/Load the first value
101 Store X/Pass the first parameter “x”
102 Load B/Load the second value
103 Store Y/Pass the second parameter “y”
104 Jns Subr/Jump to “Subr” label with return
/address
105 Load X/Load the result
106 Output/Print the first difference
107 Load C/Load the first value
108 Store X/Pass the first parameter “x”
109 Load D/Load the second value
10A Store Y/Pass the second parameter “y”
10B Jns Subr/Jump to “Subr” label with return address
10C Load X/Load the result
10D Output/Print the second difference
10E Halt/Terminate the program
10F X, Dec 0/Input value of parameter “x”
110 Y, Dec 0/Input value of parameter “y”
111 A, Dec 10/Decla...
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Essentials of Computer Organization and Architecture
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education