Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,800 of 4,675    |
|    Terje Mathisen to James Harris    |
|    Re: Fast conversion to a boolean of 0 or    |
|    07 Mar 19 07:35:50    |
      From: terje.mathisen@nospicedham.tmsw.no              On Wednesday, March 6, 2019 at 2:47:41 PM UTC-5, James Harris wrote:       > A small programming challenge if you are interested, just for fun.              What happens if you do:               neg eax        mov eax,0        adc eax,eax              This does not use any extra regs, and the NEG and the MOV should still       run in the same cycle even if they both use EAX as the target. This is       because the MOV form is known to not depend on the previous value in       EAX, so it can be started even before the NEG.              Terje                     --       - |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca