Microprocessors: From Assembly Language to C Using thePIC18Fxx2

I.2: CHAPTER 2

I.2 CHAPTER 2

1.

Write an assembly language program for the number sequencing computer that outputs the four digit sequence 0, 2, 5, 7 if LOC = 0, else output the sequence 1, 3, 6, 8. After a sequence is finished, loop back to program start. Convert your assembly language program to machine code starting at location 0.

2.

Write the assembly language for the NSC machine code program seen in Table 2.8.

Table 2.8: NSC Machine Code Program

Memory Location

Machine Code

0

100000

1

010000

2

100001

3

010000

4

100010

5

010000

6

101001

7

000000

3.

For the NSC, assume that the LOC input is tied to the least significant bit of the DOUT bus. For the program in Table 2.9, give the location executed and the DOUT value for the first 10 clock cycles.

Table 2.9: NSC Assembly Language Program

Memory Location

Machine Code

0

OUT 2

1

OUT 5

2

JC 5

3

OUT 4

4

JC 0

5

OUT 9

6

JC 2

7

JC 5

8

OUT 4

9

JC 0

4.

Repeat problem #3, except change the instruction at location #1 to OUT 4.

5.

Assume the number definition is changed to 1-X 1X 2X 3-Y 1Y 2Y 3-Z 1Z 2Z 3Z 4, with the local number as Y 1Y 2Y 3-Z 1Z 2Z 3Z 4. How many instructions are required for the...

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: Barcode Scanners
Finish!
Privacy Policy

This is embarrasing...

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