In: Computer Science
Write a subroutine that takes an int (.long) parameter and squares it. The parameter should be passed in on the stack. The answer should be returned in eax. The subroutine should not disturb any registers except eax, ecx, and edx. (Save any registers on the stack and restore them before exiting the subroutine.) Upon entry to the subroutine, push ebp, etc., to access the parameter.
[org 100h] square: sq: popa
mov ah, 4ch |
IF YOU HAVE ANY QUERY, KINDLY FEEL FREE TO ASK. AND LEAVE A THUMBS UP! THANKS!