Spring 2012 (Morrow) - ARM Microprocessor Homework, Study Guides, Projects, Research of Computer Science

Instructions for a microprocessor homework assignment focusing on arm architecture, including instruction encoding and decoding, arm7tdmi flags and conditions, addressing modes, jtag scan interface, and conditional instructions. Students are required to complete the keil uvision tutorial before starting the assignment.

Typology: Study Guides, Projects, Research

2012/2013

Uploaded on 03/23/2013

dhruv
dhruv 🇮🇳

4.3

(12)

194 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Spring 2012 (Morrow)
1
0. Keil uVision Tutorial
Prior to attempting this homework, complete the Keil uVision tutorial. You can find a link to
the tutorial on the course web page.
1. (15 points) Instruction Encoding and Decoding
a. Determine what the corresponding assembly language instructions are for the binary machine
language instructions below, and describe what the instruction will accomplish. Also write the
corresponding RTL statement(s) indicating what the instruction does.
0x229D700A
0xEA000000
b. For the following code fragment, explain how the instructions/pseudo-instructions are encoded
to ARM7 instructions (i.e. identify what the value of each field of the instruction would be
similar to chapter A4 of AARM, with a brief rationale for why that value is correct), and what
binary value they would be encoded to.
SUB R1, R2, #-43
ItsaLabel
LDR R1, =0x10000001
LDR R2, =0x01000001
ADR R3, ItsaLabel
c. Students often write code like the following fragment. Why is this inefficient? Is it ever
necessary to MOV an immediate constant into a register to be able to use that value in a data
processing instruction (see page A3-9 of AARM for the list of data processing instructions), and
if so, when?
MOV R7, #0x810000
OR R8, R8, R7
2. (5 points) ARM7TDMI Flags and Conditions
List the flag bits that are present in the CPSR, and what each represents. What determines
whether or not the C bit is updated by any MOV instruction? What determines the value of C
when it is updated?
3. (20 points) ARM7TDMI Addressing Modes
Using the uVision sample project provided on the web page as a starting point, create a complete
ARM program that has the following constants and variables. Do not make any changes to
aduc7026.s or exceptions.s. Rename main.s to teamX_hw2p3.s, where X is your homework team
number.
Docsity.com
pf3

Partial preview of the text

Download Spring 2012 (Morrow) - ARM Microprocessor Homework and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

Spring 2012 (Morrow) 1

0. Keil uVision Tutorial

Prior to attempting this homework , complete the Keil uVision tutorial. You can find a link to the tutorial on the course web page.

1. (15 points) Instruction Encoding and Decoding a. Determine what the corresponding assembly language instructions are for the binary machine language instructions below, and describe what the instruction will accomplish. Also write the corresponding RTL statement(s) indicating what the instruction does. 0x 229 D7 00 A 0xEA b. For the following code fragment, explain how the instructions/pseudo-instructions are encoded to ARM7 instructions (i.e. identify what the value of each field of the instruction would be similar to chapter A4 of AARM, with a brief rationale for why that value is correct), and what binary value they would be encoded to. SUB R1, R2, #- ItsaLabel LDR R1, =0x LDR R2, =0x ADR R3, ItsaLabel c. Students often write code like the following fragment. Why is this inefficient? Is it ever necessary to MOV an immediate constant into a register to be able to use that value in a data processing instruction (see page A3-9 of AARM for the list of data processing instructions), and if so, when? MOV R7, #0x OR R8, R8, R 2. (5 points) ARM7TDMI Flags and Conditions List the flag bits that are present in the CPSR, and what each represents. What determines whether or not the C bit is updated by any MOV instruction? What determines the value of C when it is updated? 3. (20 points) ARM7TDMI Addressing Modes Using the uVision sample project provided on the web page as a starting point, create a complete ARM program that has the following constants and variables. Do not make any changes to aduc7026.s or exceptions.s. Rename main.s to teamX_hw2p3.s , where X is your homework team number.

ECE 353 Introduction to Microprocessor Systems

Spring 2012 (Morrow) 2

  1. Declare a constant VAR_LENGTH to be equal to 8.
  2. Allocate a word variable var32 in the code area, and initialize it to 0x12345678.
  3. Allocate a byte variable named var8 in the code area, and initialize it to the binary value
    1. (Do not convert the value from binary.).
  4. Allocate an _VAR LENGTH byte array b_array in the code area, and initialize it to 1, -2, -3, 4, 5, -6, 7, -8.
  5. Allocate space in the data area for an array of ( VAR_LENGTH/2) halfword variables named hw_array.

In your program, write code to do the following (in sequence). Determine a reasonably minimal set of instructions to accomplish the required items, being sure to use the required addressing modes. (Deductions will be taken for excessive instructions.) Do not use any branches in your code. You may add constant data to your program in order to store addresses. Do not use any pseudo-instructions. Every instruction that you use must encode to precisely that instruction – check the assembler listing file to be sure.

  1. Using indirect addressing with R7, do byte transfers (as many as required) to set all elements of hw_array to the value 0xFF01. Only set the value in R7 once, and then do not alter the value in R7 to complete this item.
  2. Load the value in var32 to R8, but use two half-word loads and any other required code to get the full 32-bit value.
  3. Load the value in var8 into R9, assuming it is an unsigned value.
  4. Load the value in var8 into R10, assuming it is a signed value.
  5. Use load multiple and store multiple instructions, copy the b_array memory area to the hw_array memory area.
  6. Write code that finds the minimum value stored in the last three elements of b_array and puts the sign-extended result in R11. (Assume that the values are stored in 2’s- complement form, and that you do not know the values in the array!)

Comment teamX_hw2p4.s to clearly indicate the sections of code that correspond to each item in the list.

Important: Submit ONLY your program source code file teamX_hw2p3.s using your homework team’s dropbox in Learn@UW. Also, submit a paper copy of teamX hw2p3.s_ with the rest of the assignment.

4. (10 points) JTAG Scan Interface A. Describe the capabilities that having a JTAG scan chain adds to a processor. List the 4 signals that form the basic JTAG interface and describe their functions. What is the TAP controller, and how is it operated?

Refer to IEEE standard 1149.1 You can get that standard at IEEE Xplore going through the Wendt library site, or directly at http://ieeexplore.ieee.org/Xplore/dynhome.jsp. Going through Wendt ensures that you will not have access problems to the IEEE site.)

5. (20 points) Using Conditional Instructions