For a simple test case for my compiler project, I'm trying to divide 88 by 11, but when I call idivq
my program throws a Floating Point Exception. Here is the relevant section of generated code where the exception occurs:
# push 88
movq $88,%r10
# push 11
movq $11,%r13
# \
movq %r10,%rax
idivq %r13
I have looked up examples of how to use div
, and I thought I was following the same format, so I don't understand why I am getting an exception.