Question
The following Assembly function needs to take negative sign number. Add the external code in places where it goes in the function. External Code: //
The following Assembly function needs to take negative sign number. Add the external code in places where it goes in the function.
External Code: // Implement this inside the function so it can take negative number. You don't need to run this program just put the external code where it goes inside the function
cmp byte ptr SIGNO,-1 jnz ANOTHER mul SIGNO mov byte ptr STRING[di],'-' inc di
FUNCTION:
UNSIGNED_INT_TO_STRING PROC
mov ax, UNSIGNED_INT mov bx, 10 mov di, 0h
ANOTHER: mov dx, 0h div bx add dl, '0' mov STRING[di], dl inc di cmp ax, 0h jnz ANOTHER mov STRING[di], '$'
dec di mov si, 0
OTHER: mov ch, STRING[di] mov cl, STRING[si] mov STRING[di], cl mov STRING[si], ch dec di inc si cmp si, di jb OTHER
RET UNSIGNED_INT_TO_STRING ENDP
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started