Electronics and Communication Engineering (ECE) Exam  >  Electronics and Communication Engineering (ECE) Questions  >   Consider the following 8085 assembly program... Start Learning for Free
Consider the following 8085 assembly program:
MVI A, DATA1
MOV B, A
SUI 51 H
JC DLT
MOV A, B
SUI 82 H
JC DSPLY
DLT : XRA A
OUT PORT1
HLT
DSPLY : MOV A, B
OUT PORT2
HLT
The program will display
  • a)
    the bytes from 51H to 82H at PORT2
  • b)
    00H at PORT1
  • c)
    all bytes at PORT1
  • d)
    the bytes from 52H to 81H at PORT2
Correct answer is option 'D'. Can you explain this answer?
Most Upvoted Answer
Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI ...
Explanation:

The given assembly program is executed on the 8085 microprocessor. Let's go through the program step by step to understand its functionality.

1. MVI A, DATA1: This instruction moves the immediate data value DATA1 to the accumulator (register A).
2. MOV B, A: This instruction copies the value of the accumulator to register B.
3. SUI 51 H: This instruction subtracts the immediate value 51H from the accumulator. Since the accumulator initially contains DATA1, this instruction essentially subtracts 51H from DATA1.
4. JC DLT: This instruction jumps to the label DLT if the carry flag (JC stands for jump if carry) is set. The carry flag is set if the previous operation resulted in a borrow or underflow. In this case, if the subtraction in the previous instruction resulted in a borrow, the program will jump to the DLT label.
5. MOV A, B: This instruction copies the value of register B to the accumulator. If the previous subtraction did not result in a borrow, the original value of DATA1 is copied back to the accumulator.
6. SUI 82 H: This instruction subtracts the immediate value 82H from the accumulator. If the previous subtraction resulted in a borrow, this instruction will subtract 82H from DATA1. Otherwise, it will subtract 82H from the original value of DATA1.
7. JC DSPLY: This instruction jumps to the label DSPLY if the carry flag is set. If the previous subtraction resulted in a borrow, the program will jump to the DSPLY label.
8. DLT: This is a label where the program will jump if the carry flag is set after the first subtraction. It does not perform any operation.
9. XRA A: This instruction performs an XOR operation between the accumulator and itself, effectively setting the accumulator to zero.
10. OUT PORT1: This instruction outputs the value of the accumulator to the port specified by PORT1. Since the accumulator is zero at this point, it will output 00H to PORT1.
11. HLT: This instruction halts the program execution.

Conclusion:
Since the program outputs 00H to PORT1 and performs no other output operation, option 'C' (all bytes at PORT1) is incorrect. Similarly, the program outputs the bytes from 52H to 81H at PORT2 if the carry flag is set after the first subtraction, so option 'A' (bytes from 51H to 82H at PORT2) is incorrect. The correct option is 'D' (bytes from 52H to 81H at PORT2) as it reflects the behavior of the program when the carry flag is not set after the first subtraction.
Free Test
Community Answer
Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI ...
If DATA is less than 51H, SUI 51H will set the CY flag and execution will jump on DLP. After this A will be cleared and output at PORT1 will be 00. If DATA1 is greater than 51H and less than or equal to 82H, execution will jump on DSPLY and DATA1 will be displayed at PORT2.
Attention Electronics and Communication Engineering (ECE) Students!
To make sure you are not studying endlessly, EduRev has designed Electronics and Communication Engineering (ECE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Electronics and Communication Engineering (ECE).
Explore Courses for Electronics and Communication Engineering (ECE) exam

Similar Electronics and Communication Engineering (ECE) Doubts

Top Courses for Electronics and Communication Engineering (ECE)

Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer?
Question Description
Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? for Electronics and Communication Engineering (ECE) 2024 is part of Electronics and Communication Engineering (ECE) preparation. The Question and answers have been prepared according to the Electronics and Communication Engineering (ECE) exam syllabus. Information about Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Electronics and Communication Engineering (ECE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer?.
Solutions for Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Electronics and Communication Engineering (ECE). Download more important topics, notes, lectures and mock test series for Electronics and Communication Engineering (ECE) Exam by signing up for free.
Here you can find the meaning of Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following 8085 assembly program:MVI A, DATA1MOV B, ASUI 51 HJC DLTMOV A, BSUI 82 HJC DSPLYDLT : XRA AOUT PORT1HLTDSPLY : MOV A, BOUT PORT2HLTThe program will displaya)the bytes from 51H to 82H at PORT2b)00H at PORT1c)all bytes at PORT1d)the bytes from 52H to 81H at PORT2Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Electronics and Communication Engineering (ECE) tests.
Explore Courses for Electronics and Communication Engineering (ECE) exam

Top Courses for Electronics and Communication Engineering (ECE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev