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
Write a possible assembly language instruction or set of instructions to accomplish the following: Compare the...
Write a possible assembly language instruction or set of instructions to accomplish the following: Compare the byte stored at the memory location pointed to by register R4 to the upper (higher) byte stored in register R5 b) Branch to instruction at label ‘ZERO’ if the lower byte of register R6 is zero c) Jump to the instruction at label ‘EVEN’ if the value in register R7 is an even number
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged             Mov al, bl       And 00111111, bl       Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared             Shr al, 4       Mov bl,...
As you saw from the lab PowerPoint slides last week, you will be doing a research...
As you saw from the lab PowerPoint slides last week, you will be doing a research study looking at ‘Aggression Priming” for your first paper. For this week’s discussion, I want you to discuss with your group what you think this study is about. What is the hypothesis? What theory does it come from? What do you predict will happen (do you expect something different than the hypothesis in the researcher instructions? If so, what and why?)? Do you think...