Re: Chaning bits individually? or merging registers x86
Posted: Fri Jul 26, 2013 4:28 am
Nice attempt to move the goalposts but the simple fact is that the above statement was patently false. One is tempted to say if you believe it then it will be a long time before you are ready for osdev.For that matter, you can do it even without those instructions. add ax, 0x80 would set bit 7, and sub ax, 0x80 would clear it. That is elementary, and, if you haven't got that far, it will be a long time before you are ready for osdev.
Now, I have no intention of getting drawn into a silly argument. The answer to the OP's original question is that there are single instructions in the 80386 and newer processors to set and clear individual bits; as a bonus they also indicate the previous state of the bit. No need for add, sub, and, or to do the job. And, as the erroneous answers given indicate, it was an interesting and valid question to ask so let's all stop being so superior about "required knowledge".