Generating the min.s file and commenting on it
Below is what I have so far I need help with Generating the min.s file and commenting on it
This is done on a windows computer
This is my min.c
int min(int num1, int num2, int num3)
{
if (num1 < num2)
{
if (num1 < num3)
{
return num1;
}
}
else if (num3 < num2)
{
if (num3 < num1)
{
return num3;
}
}
else
{
return num2;
}
}
This is my min.s
.file"min.c"
.text
.globlmin
.defmin;.scl2;.type32;.endef
.seh_procmin
min:
pushq%rbp
.seh_pushreg%rbp
movq%rsp, %rbp
.seh_setframe%rbp, 0
.seh_endprologue
movl%ecx, 16(%rbp)
movl%edx, 24(%rbp)
movl%r8d, 32(%rbp)
movl16(%rbp), %eax
cmpl24(%rbp), %eax
jge.L2
movl16(%rbp), %eax
cmpl32(%rbp), %eax
jge.L3
movl16(%rbp), %eax
jmp.L1
.L2:
movl32(%rbp), %eax
cmpl24(%rbp), %eax
jge.L5
movl32(%rbp), %eax
cmpl16(%rbp), %eax
jge.L3
movl32(%rbp), %eax
jmp.L1
.L5:
movl24(%rbp), %eax
jmp.L1
.L3:
.L1:
popq%rbp
ret
.seh_endproc
.ident"GCC: (GNU) 11.2.0"
Step by step
Solved in 2 steps