ee357_hw4_sol

ee357_hw4_sol - EE 357 Homework 4 Spring 07 Redekopp...

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

View Full Document Right Arrow Icon
EE 357 Homework 4 Spring ’07· Redekopp Name: _ Solutions ____________________________________ Lec: 9:30 / 11:00 / 2:00 Due: Mon./Tues. Feb. 12 th /13 th Score: ________ Stacks and Subroutines 1.) In addition to passing parameters in registers or by using the stack, another possible method is to provide space for them in the code itself. Study the code below to understand how this method works and answer the following questions. (Note that in this method we are going to explicitly change the return address that the BSR pushes onto the stack). Show any work on an extra page and submit that with your homework. a.) Before the call to SUB1 (BSR.L SUB1), what are the longword contents of PAR, D0 and D4. b.) After program execution , what are the longword contents at locations PAR and RET as well as the register contents of D0,D1,D4,D5,A4? c.) Show the word contents of the system stack just after the ASR instruction is executed d.) Show the machine code of the “BSR.L SUBR” instruction d.) Machine code for the “BSR.L SUB1” = 6100 06FC ORG $7AC0 7AC0 BEGIN MOVE.L #HERE+4,D4 7AC6 MOVE.L HERE+2,D5 7ACA MOVE.L #$BEADFACE,D1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/26/2008 for the course EE 357 taught by Professor Mayeda during the Spring '08 term at USC.

Page1 / 3

ee357_hw4_sol - EE 357 Homework 4 Spring 07 Redekopp...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online