Current code, simplified:
mov ecx, 10
cdq
div ecx
cdq
div ecx
Equivalent faster, but longer code:
imul eax, 0xcccd
shr eax, 19
imul eax, 0xcccd
shr eax, 19
And yes, as EAX is guaranteed to be small (<= 200) it is equivalent!
Should I really care, or not? And what would a modern compiler generate?
Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather -
https://prino.neocities.org/
Some REXX code for use on z/OS -
https://prino.neocities.org/zOS/zOS-Tools.html
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)