.file "pfqx86.s" .version "01.01" .text .align 4 .globl queens .type queens,@function queens: push %ebx push %ecx push %edx push %esi push %edi mov 24(%esp),%edx mov 28(%esp),%ebx mov 32(%esp),%eax xor %ecx,%ecx push $0 push $0 push $0 push $0xffffffff jmp enter # a0=ecx, inc zet geen cf #d0=edx #d1=ebx #d2=eax #d3=esi #d4=edi loop: sub %edi,%esi #d3-=d4 push %eax push %ebx push %edx push %esi sub %edi,%edx #d0-=d4 (set CF) jbe found #jump below or equal (CF|ZF) or %edi,%ebx #d1|=d4 or %edi,%eax #d2|=d4 add %ebx,%ebx #d1*=2 shr $1,%eax #d2/=2 enter: xor %edi,%edi #d4=0 mov %ebx,%esi #d3=d1 or %eax,%esi #d3|=d2 not %esi #d3=~d3 and %edx,%esi #d3&=d0 jne for #jump not zero (ZF) return: pop %esi pop %edx pop %ebx pop %eax for: sub %esi,%edi #d4-=d3 and %esi,%edi #d4&=d3 jne loop #jump not zero (ZF) jmp return found: inc %ecx #a0++, no CF set jnc return dec %ecx pop %eax pop %eax pop %eax pop %eax mov %ecx,%eax pop %edi pop %esi pop %edx pop %ecx pop %ebx ret .Lfe1: .size queens,.Lfe1-queens