flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 16 Feb 2012, 16:31
Use idiv instruction.
[edit]And cdq instead of "xor edx, edx" |
|||
![]() |
|
Apos 16 Feb 2012, 16:35
That was fast!
Very interesting. I'll have to look into cdq, it looks like idiv doesn't give the right result without it. |
|||
![]() |
|
AsmGuru62 16 Feb 2012, 17:33
IDIV works with EDX:EAX and you set EDX to zero - EDX must have sign extended over all its bits.
CDQ does just that - it takes the bit sign from EAX (bit #31) and sets all bits in EDX to that bit value. |
|||
![]() |
|
rugxulo 16 Feb 2012, 21:39
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.