in CO and Architecture edited by
8,677 views
3 votes
3 votes

What will be the output at $\text{PORT1 }$if the following program is executed?

MVI B, 82H
MOV A, B
MOV C, A
MVI D, 37H
OUT PORT1
HLT
  1. $37H$
  2. $82H$
  3. $B9H$
  4. $00H$
in CO and Architecture edited by
8.7k views

4 Answers

3 votes
3 votes

ans must be B 

MVI B, 82H      // move immediate  82 in hexadecimal   to register B

MOV A, B      // move  value of B 82 in hexa to  acc A

MOV C, A      //  move value of A  to register C

MVI D, 37H       //  move immediate the  value 37 in hexa  to register D

OUT PORT1     //  output the value of port1 i.e of  acc A  hence 82 H will be the output

HLT  //halt the computer

1 comment

How we came know that A is accumulator and B & C are register??

Please clear my doubt.
1
1
2 votes
2 votes

Answer : Option B

In 8085 programming, the result of an operation is stored in the accumulator.

Reference : https://www.iitg.ernet.in/asahu/cs421/Lec26.pptx

                 https://www.iitg.ernet.in/asahu/cs421/Lec21.pptx

4 Comments

FIRST 4 LINES ARE OBVIOUS  WHAT OUT PORT1 AND HALT DOES
0
0
OUT PORT1

moves the content of Accumulator to the port address given by PORT1.

HLT

After this instruction gets executed control comes back to the same instruction - so processor stops execution.
0
0
WHAT IS ADDRESS GIVEN BY PORT1 HERE              OF A OR D
0
0
I guess it is not given in the code. But I don't remember 8085 now- you can see it in text.
0
0
1 vote
1 vote
  • MVI B, 82H                  // Copy value 82H to register B
  • MOV A, B                   // Copy value of B (82H)  to accumulator A
  • MOV C, A                  //  Copy value of A (82H)  to register C
  • MVI D, 37H                //  Copy value 37H to register D
  • OUT PORT1              //Copy value of A(82H) to PORT 1

So output will be 82 H

Answer B

by
1 vote
1 vote

The output at PORT 1 will depend on the hardware configuration and the value written to the port.

In the given program, the value 37H is loaded into the D register, but it is not used. The MOV instruction copies the value in the B register (82H) to the A register, and then the MOV instruction copies the value in the A register to the C register.

Finally, the OUT instruction is used to write the value in the accumulator (which contains 82H) to PORT1. The specific effect of writing to PORT1 will depend on the hardware connected to that port. It is not possible to determine the output at PORT1 without more information about the system being used.

Answer:

Related questions