Here i only have 6 Bit's permutation, but with more the sequence is the same.
Start with all Bit's on the right side.
Is this possible without loops?
Code: Select all
Procedure BitSet(VAR, NR)
EnableASM
MOV rbx, [p.v_NR]
DEC rbx
MOV rax, [p.v_VAR]
BTS rax, rbx
DisableASM
ProcedureReturn
EndProcedure
Procedure BitClear(VAR, NR)
EnableASM
MOV rbx, [p.v_NR]
DEC rbx
MOV rax, [p.v_VAR]
BTC rax, rbx
DisableASM
ProcedureReturn
EndProcedure
Start=0: X=1
For a=1 To 44
Start=BitSet(Start, a)
For b=1+a To 45
Start=BitSet(Start, b)
For c=1+b To 46
Start=BitSet(Start, c)
For d=1+c To 47
Start=BitSet(Start, d)
For e=1+d To 48
Start=BitSet(Start, e)
For f=1+e To 49
Start=BitSet(Start, f)
Debug RSet(Bin(Start+ROL), 49, "0") + " - " + Str(X)
Start=BitClear(Start, f)
X+1
Next
Start=BitClear(Start, e)
Next
Start=BitClear(Start, d)
Next
Start=BitClear(Start, c)
Next
Start=BitClear(Start, b)
Next
Start=BitClear(Start, a)
Next