I try to find a replacement for the GFA 'Bchg' command. It does change one bit of the value at a given position.
a.l=7
a=Bchg(a,3) ;should return 3
a=Bchg(a,3) ;should return back 7
I found an (old) macro here but it doesn't work (and I think it's not the correct setup neither).
Code: Select all
Macro Bchg(i,n)
Int(Pow(i,1 << n))
EndMacro
Code: Select all
Procedure Bchg(i,n)
ProcedureReturn i ~(1 << n) ; i NOT(1 << n)
EndProcedure
Thanks.