Morkin wrote: ↑Sun Nov 22, 2020 2:01 pm
It hurts my brain trying to work out whether to use
F & 01 = 1 or
F & 01 = 0 to check the different NZ, Z, NC, C combinations but the principle is sound
It's easy. Mask is a 2^position of needed flag in register F :
76543210
SZ-H-PNC,
NC is for CF=0, Mask for CF is 2^0 = 1, Value=0; C is for CF=1, Value=Mask=1
NZ is for ZF=0, Mask for ZF is 2^6=64=#40, Value=0, Z is for ZF=1, Value=Mask=64=#40.
PO is for PF=0, PE is for PF=1, Mask=2^2=4
P is for SF=0, M is for SF=1, Mask=2^7=128=#80
Or
NC: Mask=1 Value=0
C: Mask=1 Value=1
NZ: Mask=64 Value=0
Z: Mask=64 Value=64
PO: Mask=4 Value=0
PE: Mask=4 Value=4
P: Mask=128 Value=0
M: Mask=128 Value=128