EE 445 Homework 1 by bKvSFpe

VIEWS: 13 PAGES: 2

									                                  EE 345 Homework 2
                                      Due 5/8/12

Total Points: 15

Question 1: (5 points)
Textbook Exercises:2-17, 30, 36, 41, 50.



Question 2: (5 points)
Textbook Exercises: 3-21, 3-23
Notes: You have to simulate the programs in Chapter 3 using THRSIM11 to verify the
answers. (show evidence of the correct execution of your code)




Question 3: (5 points)
The following shows the 68HC11 assembly code for the example on page 108.

* p108 of the textbook

1                  ORG      $0020    start of RAM (data)
2        AT1       RMB      2
3        Space     RMB      1
4        Length    RMB      1
5        Count     RMB      1
6        Ptr       RMB      2
7                  ORG      $E000    start of ROM (program)
8        START     LDX      AT1
9                  STX      Ptr
10                 LDAA     Length
11                 STAA     Count
12                 LDAB     Space
13       LOOP      TST      Count
14                 BEQ      STOP
15                 LDX      Ptr
16                 LDAA     0,X
17                 ABX
18                 STAA     0,X
19                 DEC      Count
20                 LDX      Ptr
21                 INX
22                 STX      Ptr
23       BRA       LOOP
24       STOP


Use the THRSim11 to show your answers of the following questions. (with screenshots
of progress of the code, execution-register status, memory list, etc.)
1) Show a scenario if a 6-element table is copied from address 007f to 009d (you
   may arbitrarily enter the values of the 6 elements).
2) Revise the program so the TST Count on line 13 will not be needed. (i.e., the
   BEQ branch instruction on line 14 will examine the right status of program
   execution to determine the branch condition.)
3) Revise the program so the “Ptr RMB 2” on line 6 will not be used. Instead,
   Register X points to the element in Table 1, and Register Y points to the element
   in Table 2.

								
To top