I have these expressions:
cltd idivl (%ecx)
when dividing by an int, and:
int
movl $0, %edx divl (%ecx)
when dividing an unsigned long
unsigned long
cltd
idiv performs signed division, div performs unsigned division.
idiv
div