{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework3_solution - Assigned Due CprE 211 Spring 2005...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Assigned: 3/1/05 Due: 3/10/05 1 CprE 211 – Spring 2005 Homework 3 Remember, these homework exercises not only give you practice with course concepts, but also represent the types of questions you will be tested on in an exam. I. Answer the following short questions: 1. What is the format of the CR register? There are eight fields, CR0-CR7. Each CR field has four bits: 0 – LT, 1 – GT, 2 – EQ, 3 – SO. 2. What are the exception bits in the XER register? SO – Summary overflow OV – Overflow CA – Carray 3. What is the use of the LR register? LR is Link Register. 1. Provide the branch target address for a branch instruction that uses LR as the target address. 2. Hold the address of instruction that follows a branch and link instruction. 4. [2] Using PowerPC assembly instructions, write code to store the integer value 0x23000034 (4-byte) into memory at address 0x200055C0. Notes: To use store instruction, the value to be stored must be saved in a register. To use a 32-bit address, the upper half of the address must be put into a register. Thus, let r3 hold 0x23000034 and r4 hold the address. lis r3, $2300 ori r3, $0034 lis r4, $2000 stw r3, $55C0(r4) 5. The instruction lis is a pseudo instruction. How is it translated to a native PowerPC instruction? lis rA, value addis rA, 0, value
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Assigned: 3/1/05 Due: 3/10/05 2 II. Consider the following memory dump and PowerPC registers. Assume that byte-ordering is big endian (big byte first, i.e ., MSB at lower address) and memory addresses are 32 bits wide. Address Memory Contents 30001FF8 25 24 5B 1A AC 57 9C 8D 30002000 00 FE 25 24 5B 1A EE 05 30002008 AC AE 81 83 45 67 89 25 30002010 01 23 55 3F AC CB F0 8D 30FF0000 30 00 FF 18 20 00 10 8C 30FF0008 AC AE 81 83 30 00 32 00 30FF0010 30 00 50 04 AC CB F0 8D 30FF0018 30 FF 00 50 20 00 10 A8 Register
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}