UP | HOME

HW23
COP-3402

  1. Draw the stack frames for the following two functions (after running main and calling f, but before f returns). Remember to include:

    • The return address.
    • The old base pointer.
    • The local variables.
    function main
    localVariables retval x
    x := 3
    retval := call f a
    return x
    end function
    
    function f
    localVariables x
    parameters x
    x := 2
    return x
    end function
    
  2. Write mov instruction(s) that implement x := 2 above in the function f.
  3. In the x86 64 System V ABI, how are parameters passed?

Author: Paul Gazzillo and Brent Pappas

Created: 2026-07-22 Wed 07:21

Validate