Question: Explain this code line by line using a comment. void un_division(unsigned int x, unsigned short int y) { unsigned int r; _asm { MOV EDX,
Explain this code line by line using a comment.
void un_division(unsigned int x, unsigned short int y)
{
unsigned int r;
_asm
{
MOV EDX, 0;
MOV EAX, x;
MOV BX, y;
DIV BX;
MOV r, EAX;
}
void division(int x, short int y)
{
int r;
_asm
{
MOV EDX, 0;
MOV EAX, x;
MOV CX, y;
IDIV CX; //division of y and x
MOV r, EAX;
}
void multiplication(short int x, short int y) //32 bit parameters
{
short int r; //intitate r to hold the value
_asm //assembly code
{
MOV AX, x; //move first input to register EAX (32 bit)
MOV CX, y; //move input y into register EBX
IMUL AX, CX; //multiply of EAX and EBX
MOV r, AX; //move result to a variable r
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
