{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ce12_w08_hw6 - CMPE 12 Winter 2008 Homework 6 Due February...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPE 12 Winter 2008 Name:________________ Homework 6: Due February 27 Email:________________ .orig x3000 INIT: LD R0, var1 JSR FUN1 LD R0, var2 JSR FUN1 LD R0, var3 JSR FUN1 AND R1, R1, 0 MAIN: JSR FUN2 ADD R1, R0, 0 JSR FUN2 NOT R0, R0 ADD R0, R0, #1 ADD R1, R0, R1 JSR FUN2 ADD R1, R0, R1 ST R1, var4 HALT FUN1: LD R6, ObjP STR R0, R6, 0 ADD R6, R6, #1 ST R6, ObjP RET FUN2: LD R6, ObjP ADD R6, R6, #-1 LDR R0, R6, 0 ST R6, ObjP RET var1: .FILL x40 var2: .FILL x56 var3: .FILL #-31 var4: .FILL 0 ObjP: .FILL Obj Obj: .BLKW 5 .end 1) a) (12 pts) When the PC reaches MAIN , what are the values stored in x301F-x3024? ( ObjP = x301F) b) (3 pts) What is the value of var4 after this program is done executing? 2) In this program, Obj is a 'stack' datastructure. Subroutine FUN1 is a 'push' function. a) (5 pts) What function is subroutine FUN2 ? c) (4 pts) Which register is acting as the stack pointer?
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern