For the questions below, write the code using the masks that are pre-defined in
ID: 2085669 • Letter: F
Question
For the questions below, write the code using the masks that are pre-defined in the header file. (E.g. BIT0: 0000 0001, BITI: 0000 0010, ..., BIT7: 1000 0000). Perform the operations below on the 8-bit variable (unit_8t data). a) Write code that performs the three operations below. Perform each operation independently of the others. Set bit 3. Clear bit 3. Invert bit 3. b) Write code that performs the three operations below. Perform each operation independently of the others. Set bits 3 and 5. Clear bits 3 and 5. Invert bits 3 and 5. Set bit 3 and clear bit 5. c) Write an if-condition line for each of the cases below. Perform each operation independently of the others. Check if bit 5 is 1. Check if bit 5 is 0. Check if bits 6, 7 are 1, 1. Check if bit 7 is 0 and bit 6 is 1. Check if bits 6, 7 are 0, 0.Explanation / Answer
WRITING PROGRAM IN ASSEMBLY LANGUAGE FOR 8085 MICROPROCESSOR
The same logic can be used anywhere
Let Data of different Bits from BIT1 to BIT8 are stored in Memory location 2000H to 2007H in our 8085 microprocessor.
Now ,
Writting Program from above situation:
a)TO SET , THEN CLEAR , THEN INVERT THE BIT3 LOCATED AT 2052H
LXI H,2052H
MOV A,M
MVI B,FFH
ORA B
MOV A,M
MVI B,00H
ANA B
MVI A,00H
MOV B,M
SUB B
MOV C,FFH
ADD C
MOV M,A
Above code perform all three speified operations on BIT3
Part B)
LXI H,2052H
MOV A,M
MVI B,FFH
ORA B
MOV A,M
MVI B,00H
ANA B
MVI A,00H
MOV B,M
SUB B
MOV C,FFH
ADD C
MOV M,A
INX H
INX H
MOV A,M
MVI B,FFH
ORA B
MOV A,M
MVI B,00H
ANA B
MVI A,00H
MOV B,M
SUB B
MOV C,FFH
ADD C
MOV M,A
PART C)
LXI H,2054H
MVI B,FFH
MOV A,M
CMP B
JZ LOOP
LOOP OUT PORT1
MVI B,00H
MOV A,M
CMP B
JZ LOOP1
LOOP1:OUT PORT2
SIMILARLY ALL OUTPUTS CAN BE CHECKED.
PLEASE RATE MY ANSWER , IF YOU WERE EXPECTING SOMETHING ELSE OR ANY OTHER HELP I WIIL HELP YOU OUT IN COMMENT SECTION
THANK YOU
PLEASE RATE IF YOU LIKE
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.