Microprocessors: From Assembly Language to C Using thePIC18Fxx2

I.3: CHAPTER 3

I.3 CHAPTER 3

1.

Convert the instruction addwf 0x030,f to machine code.

2.

Convert the instruction addwf 0x230,f to machine code.

3.

Convert the instruction goto 0x043E to machine code.

4.

Convert the machine code 0x010A to a PIC18 instruction.

5.

Convert the machine code 0xC2A5 0xF100 to a PIC18 instruction.

6.

Convert the instruction word 0x0E09 to a PIC18 instruction.

7.

What memory location is modified by the instruction addwf 0x230, f, BANKED (warning: this is a trick question)?

8.

Write PIC18 assembly that will accomplish k = i-j where i is location 0x100, j is location 0x240, and k is location 0x030. The variables i, j, k are all byte variables.

9.

Given a 16 MHz clock, how long do the three instructions starting from location 0x0210 ( addwf, movwf, goto) of Listing 3.13 take to execute? Give the answer in microseconds.

10.

Write a PIC18 instruction sequence that accomplishes k = i + j + 5, where i, j, and k are in the same locations as Listing 3.9.

11.

Write a PIC18 instruction sequence that copies file register locations 0x100 through 0x103 to locations 0x200 through 0x203.

12.

How many NOP instructions are executed in one second assuming a 25 MHz FOSC?

13.

What is the value of W after the instruction subwf WREG,w is executed?

Answers

1.

addwf 0x030, f = 0010 01da ffff ffff; destination is

UNLIMITED FREE ACCESS TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Microprocessor Chips (MPU)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.