Question

Modify the following assembly code section in order to make: The pins 0 and 1 of PORTA inputs. All PORTB pins outputs, PORTB pins 7,5, 3 & 1 ave the logic value 1. BCF STATUS RPO MOVLW b00000000 MOVWF TRISA. MovLW 10101010 Mov WF TRISB STATUS, RPO BSF MOVLW b01010101 MOVWF TRISB 2. The register which indicates that exact part of the execution seque where the program is running is called? 3. Write just the assembly code section to evaluate the sum of 0x48 0x26 4. Explain the difference between SUBWF and SUBWFB 5. What is the STATUS REGISTER? What is used for? 6. What is the difference between reading the LATCH REGISTER reading the PORT REGISTER
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

BCF status,RP0

MOVLW b'00000011'; 0&1 pins are inputs and remaining are outputs;

MOVWF TRISA;

MOVLW b'00000000';all the pins are outputs;

MOVWF TRISB;

BSF status,RP0

MOVLW b'10101010'; port B pins 7,5,3 & 1 have the logic value 1.

MOVWF TRISB;

2.
Program Counter(PC) : Program counter is a register that contains the address (location) of the instruction being executed at the current time.
Instruction Pointer (IP): IP contains the address of the next instruction to be executed.

3.

Mov AX,#48h;
Mov BX,#26h;
Add AX,BX; Result is stored in AX

The syntax may change for different processors or controller, but the logic is same.

4.
Subwf is simply subtraction of word from f, wheras subwfb is subtraction along with the borrow.


Please rate it if you get the answer. Thanks...)

Add a comment
Know the answer?
Add Answer to:
Modify the following assembly code section in order to make: The pins 0 and 1 of...
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