Register A of a hypothetical CPU contains a binary value 10011001. A programmer needs to make all the bits zero. Is it possible to achieve this without using MOVE or SUBTRACT instructions?
Could i just AND those bits with all zero's 10011001 & 00000000?
Or do i have to do four seperate bit mask XORs saving the result each time or something?
I would use said hypothetical CPU's register clear instruction myself...
Or if you're going to go to the effort of loading a separate register with all 0's to and it with the other register why not just load the register you're trying to clear with all 0's in the first place?
I have no idea what instruction you would use as I've never used a hypothetical instruction set, only real ones! =) It's not a dumb question but make sure you provide details about what you're talking about or we can't help you.
You can always exclusive or the register with itself, or and it with its complement, or add it to its complement. If you can use shifting then logical left or right shift will give you zeros.