Question: 1) (5 points) Translate the following short C program into assembler. Use the stack to exchange ALL parameters (assume int's take 2 bytes of storage,

1) (5 points) Translate the following short C program into assembler. Use the stack to exchange ALL parameters (assume int's take 2 bytes of storage, and long's take 4 bytes of storage). Return the result in register D. Ensure that the registers, other than D, used by the subroutine age using the OFFSET directive and labels as offsets into the stack. Function: intDivide Description: Divide unsigned 32-bit integer by unsigned 16-bit integer Value returned is the quotient of the division, the remainde is discarded unsigned int intDivide (unsigned long vall, unsigned int val2) unsigned long quotient; quotientval1 / va12; return (quotient) 1) (5 points) Translate the following short C program into assembler. Use the stack to exchange ALL parameters (assume int's take 2 bytes of storage, and long's take 4 bytes of storage). Return the result in register D. Ensure that the registers, other than D, used by the subroutine age using the OFFSET directive and labels as offsets into the stack. Function: intDivide Description: Divide unsigned 32-bit integer by unsigned 16-bit integer Value returned is the quotient of the division, the remainde is discarded unsigned int intDivide (unsigned long vall, unsigned int val2) unsigned long quotient; quotientval1 / va12; return (quotient)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
