Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

MICROPROCESSOR:

Simulate the program and find the final answer. Identify the purpose of the Program.

a. Program No. 1

1.

LXI H, 6000H :"Initialize pointer l to first number"

2.

LXI D, 6l00H :"Initialize pointer2 to second number"

3.

LXI B,

6200H   :"Initialize pointer3 to result"

4.

STC

5.

CMC :"Carry = 0"

6.

BACK: LDAX D :"Get the digit"

7.

ADD M :"Add two digits"

8.

DAA :"Adjust for decimal"

9.

STAX.B :"Store the result"

10.

INX H :"

Increment pointer 1"

11.

INX D :"Increment pointer2"

12.

INX B :"Increment result pointer"

13.

MOV A, L

14.

CPI 06H :"Check for last digit"

15.

JNZ BACK :"If not last digit repeat"

16.

HLT :"Terminate program

execution"

a.

Program No. 2

1.

LXI H, 2200H :"Initialize memory pointer l"

2.

LXI D, 2300H :"Initialize memory pointer2"

3.

MVI C, 32H :"Initialize counter"

4.

BACK:MOV A, M :"Get the number"

5.

ANI 0lH :"Check for even number"

6.

J

NZ SKIP :"If ODD, don't store"

7.

MOV A, M :"Get the number"

8.

STAX D :"Store the number in result list"

9.

INX D :"Increment pointer 2"

10.

SKIP: INX H :"Increment pointer l"

11.

DCR C

:"Decrement counter"

12.

JNZ BACK :"If not zero, repeat"

13.

HLT :"Stop

a.

Program No. 3

2.

LDA 2200H

3.

MOV C, A :"Initialize counter"

4.

LXI H, 2201H :"Initialize pointer"

5.

MVI E, 00 :"Sum low = 0"

6.

MOV D, E :

"Sum high = 0"

7.

BACK: MOV A, M :"Get the number"

8.

ANI 0lH :"Mask Bit 1 to Bit7"

9.

JZ SKIP :"Don't add if number is even"

10.

MOV A, E :"Get the lower byte of sum"

11.

ADD M :"Sum = sum + data"

12.

MOV E, A :"St

ore result in E register"

13.

JNC SKIP

14.

INR D :"Add carry to MSB of SUM"

15.

SKIP: INX H :"Increment pointer"

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education