Thanks! It worked! It was quite a puzzle for a beginner like me, but it works! Now I understand the use of bit masking. I did this: ld a,1 ;The number I want to test and %10000000 cp 0 jp z,Positive jp nz,Negative Is this the best way to do it? :) Marc