Question

8. The following program sequence tries to drive the LEDS so that LEDS-LEDO, LED2, LED4, LED6 turns on one at a time starting
using assembly language
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :- First of all, the delay subroutine must be written. Next the instruction movb must use increment factor as 1 in place of 2 since data is of byte size. So the instruction would be -

movb 1, X+, portb

Same applies to the CPX instruction and it must be-

cpx #led_tab +5

Also the array data in led_tab is not correct and must be defined as-

led tab dc.b $01, $04, $10, $40

as $01 = 0000_0001, $04 = 0000_0100 and so on.

These four errors are preventing the code to give proper output.

Dear student, to write the delay subroutine we must know the frequency of the processor. Please comment on this.

Add a comment
Know the answer?
Add Answer to:
using assembly language 8. The following program sequence tries to drive the LEDS so that LEDS-LEDO, LED2, LED4, LE...
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