EE357-HW3_solutions-Nazarian-Fall09

# EE357-HW3_solutions-Nazarian-Fall09 - EE 357 Homework 3...

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

EE 357 Homework 3 Solutions Fall 2009 Nazarian Name: ___________________________________________ Assigned Friday, Oct. 2 Due: Tuesday, Oct. 13 in class (RTH109) Score: ________ For problems Error! Reference source not found. and Error! Reference source not found. and Error! Reference source not found. consider the following assembly code. .text 20000500 BEGIN: MOVE.L #-1,D0 0506 MOVE.L #16,D1 050C L1: BSR.W SUB1 0510 STOP #\$2700 .org 0x200 0700 SUB1: TST.L D1 0702 BEQ.S EXIT 0704 LSR.L #1,D1 0706 ADDQ.L #1,D0 0708 L2: BSR.S SUB1 070A EXIT: RTS D0 D1 SP PC I) 0xffffffff 0x00000010 0x20003578 0x20000700 II) 0x00000000 0x00000008 0x20003574 0x20000700 III) 0x00000004 0x00000000 0x20003568 0x2000070A IV) 0x00000004 0x00000000 0x2000357c 3560 3564 0x2000070A 3568 0x2000070A 356C 0x2000070A 3570 0x2000070A 3574 0x2000070A Initially 3578 0x20000510 SP=2000357C --> 357C 3.) Performing log 2 n where n is in D1 and output is in D0

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

View Full Document
Stack Frames int doit(int *x, int len, int z) { int i, sum=0; for(i=z; i<len; i++)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/14/2010 for the course EE 357 at USC.

### Page1 / 3

EE357-HW3_solutions-Nazarian-Fall09 - EE 357 Homework 3...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online