Question

1.Write a set of PIC assembly language instructions for each of the following flowcharts: 〈VALUE-20H TRUE VALUE> 30 TRUE 11 F

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :- The PIC micro-controller assembly code has been written below-

Label_A :
MOVLW 20 ; W = 20
SUBWF VALUE, 0 ; W = W - 20, if VALUE is 20 then zero flag sets
BTFSC STATUS, 2 ; skip next line if zero flag is not set
GOTO Label_B; ; go to label named as Label_B somewhere in code
GOTO Label_A ; else go to to label Label_A

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Label_A :
MOVLW 30 ; W = 30
SUBWF VALUE, 0 ; W = W - VALUE, if VALUE is equal to 30 then zero flag sets, if greater than 30 then carry flag sets
BTFSC STATUS, 2 ; skip next line if zero flag is not set
GOTO Label_B; ; go to label named as Label_B somewhere in code
BTFSC STATUS, 0 ; skip next line if carry flag is not set
GOTO Label_B ; go to label named as Label_B
GOTO Label_A ; else go to to label Label_1

Add a comment
Know the answer?
Add Answer to:
1.Write a set of PIC assembly language instructions for each of the following flowcharts: 〈VALUE-20H TRUE...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT