Question

b. The program code below involves IO. The first line of an interrupt (IRQ) service routine is also shown. Describe the purpo
0 0
Add a comment Improve this question Transcribed image text
Answer #1

PORTC   EQU $1003 //Assign Address $1003 to label PORTC (I/O port C reg)
DDRC    EQU $1007 //Assign Address $1007 to label DDRC(Data Direction Reg C)
STACK   EQU $4FFF //Assign Address $4FFF to label STACK(Initial Stack Pointer
IRQVECT   EQU $FFF2 //Assign Address $FFF2 to label IRQVECT(Interrupt service routine vector)

ORG    $1000 //main origin

START SEI //Set global interrupt flag

LDS      #STACK   //initialize stack pointer
LDD      #INTSERV //Load D with #INTSERV
STD       IRQVECT //Store D to IRQVECT
LDAA   #$0F //put $0F into A
STAA   DDRC //to make PORTC pin PC7-PC0 as output and other pin as input
STAA   PORTC //Write from Reg A to Port C
CLI //Enable IRQ
....more code

ORG       $2000 //interrupt origin

INTSERV LDAB    PORTC //put PORTC value into Register B
       ...

Add a comment
Know the answer?
Add Answer to:
b. The program code below involves IO. The first line of an interrupt (IRQ) service routine is also shown. Describe...
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
  • Can anyone explain this code? I get the gist of it, but having someone explain this...

    Can anyone explain this code? I get the gist of it, but having someone explain this code would be helpful ;***************************************************************** ;   Data section    ;*****************************************************************    ORG DATA   ;***************************************************************** ;    Main program section    ;*****************************************************************    ORG CODE   Main: LDS #STACK LDAA #%00000100 STAA DDRT    LDAA #$80 STAA TSCR1 LDAA #$07 STAA TSCR2 BSET TIOS, %00000100 LDAA #$10 STAA TCTL2 CLI LDAA #$04 STAA TIE       Here NOP BRA Here ;***************************************************************** ;    Subroutine section ;*****************************************************************...

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