Question

Give the instructions to set up port T to allow a dip switch to be hooked...

Give the instructions to set up port T to allow a dip switch to be hooked up, and

then

branch to the label SW1ON if the most significant bit is a zero in ASSEMBLY LANGUAGE (CODE WARRIOR)

Homework Answers

Answer #1

Answer :- The steps and assembly code is written below-

DDRT = 0x00; make all pins as input
Read PTT register and check if MSB is zero then goto label SW1ON
Note here that when switch is hooked up the pin is connecting to ground through theswitch and hence we will get 0 on that pin (MSB of port T).


The assembly code is written below-
LDAA #$00 ;register A = 0000_0000
STAA DDRT ;make port T pins as input pins
LDAA PTT ;read port T register and keep value in register A
ANDA #$80 ;get MSB of read value in register A
BEQ SW1ON ;goto label named as SW1ON if A value is zero

Know the answer?
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
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT