Hi, I would like to get some help on a simple program. I wanted to compare the most significant nibble from P2(so P2.4 to P2.7) with a number using CJNE, but I don't know how to select that number from the nibble to introduce it in the CJNE
How about shifting it down 4 steps?
Or mask with 0xf0 and compare with a 16 times larger value?
oh, right, I don't how I didn't think of that... been tired lately. But thanks!
Don't forget that instead of shifting down 4 steps, you can also mask your nibble and do a SWAP to exchange place of low/high nibble of A.
And don't hesitate to ask all your other assignment questions here.
There will always be someone available to provide the full answer.
But "mask with" isn't really "the full answer". It most definitely takes a visit to the processor instruction set documentation to get a usable solution.
The important thing is that there are normally many different ways something can be solved. Solving and handing in one specific solution would not make a student see/realize other choices.