Question: undefined The FUNCTION subroutine featured in the sample code accepts two 16-bit values as parameters, and also returns a 16-bit value as its result. To

undefined
The FUNCTION subroutine featured in the sample code accepts two 16-bit values as parameters, and also returns a 16-bit value as its result. To complete the challenge for this lab, provide detailed answers to the following questions: 1. What type of operation does the FUNCTION subroutine perform on its two 16-bit inputs? How can you tell? Give a detailed description of the operation being performed by the FUNCTION subroutine. 2. Currently, the two 16-bit inputs used in the sample code cause the "brcc EXIT" branch to be taken. Come up with two 16-bit values that would cause the branch NOT to be taken, therefore causing the st Z, XH instruction to be executed before the subroutine returns. 3. What is the purpose of the conditionally-executed instruction "st Z, XH"? Functions and Subroutines XH, YLI ; Func: FUNCTION ; Desc: ??? i FUNCTION: ldi ldi ldi ldi ldi ldi ld ld add st ld ld adc st brcc st EXIT: ret XL, 900 $01 $02 YH, $01 ZL, $04 ZH, $01 A, X+ B, Y+ B, A 2+, B A, X B, Y B A 2+, B EXIT 2, XH ; return from rcall The FUNCTION subroutine featured in the sample code accepts two 16-bit values as parameters, and also returns a 16-bit value as its result. To complete the challenge for this lab, provide detailed answers to the following questions: 1. What type of operation does the FUNCTION subroutine perform on its two 16-bit inputs? How can you tell? Give a detailed description of the operation being performed by the FUNCTION subroutine. 2. Currently, the two 16-bit inputs used in the sample code cause the "brcc EXIT" branch to be taken. Come up with two 16-bit values that would cause the branch NOT to be taken, therefore causing the st Z, XH instruction to be executed before the subroutine returns. 3. What is the purpose of the conditionally-executed instruction "st Z, XH"? Functions and Subroutines XH, YLI ; Func: FUNCTION ; Desc: ??? i FUNCTION: ldi ldi ldi ldi ldi ldi ld ld add st ld ld adc st brcc st EXIT: ret XL, 900 $01 $02 YH, $01 ZL, $04 ZH, $01 A, X+ B, Y+ B, A 2+, B A, X B, Y B A 2+, B EXIT 2, XH ; return from rcall
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
