I am taking a microcontroller course and we are studying the ARM Processor architecture. We are currently talking about data processing instructions (arithmetic, comparison, logical, and data movement). I understand the concepts of arithmetic comparison and data movement instructions and how they work when they are written in a code. However, I do not understand how logical instructions work. In our lectures, we were given 3 examples and I do not understand none of them.
Example 1: AND r0, r1, r2 ;r1 AND r2, store the result in r0 (I kind of understand this one but not really. If r1 and r2 are different, is it going to compare the 32 bit number and compare them and store the result in r0? For example, if R1 is 0101 and R2 is 1111, R0 would then be equal to 0101 and this is because it needs to be 1 in both in order for that bit to be set right?)
Example 2: BICEQ r2, r3, #7 ; if Z=1, clear 3 right bits of r3, store the result in r2 (This one I completely dont understand. What does it mean by clear 3 right bits, and where is this 3 right bits coming from. What happened to the 7? I get the storing in r2 since that is our destination register. But I completely don't get this instruction. In the notes he gave us it says "BIC means operand 1 AND NOT operand 2 ; Bitwise AND of Op1 and NOT Op2 - Clear specific bits." Also I get what EQ means, its the condition and Z needs to bet set in order for that instruction to execute.
Example 3: EORS r1, r3, r0 ; r3 exclusive OR r0, store result in r1, set flags ( I also dont understant what this instruction is doing. I do understand the S in the instruction is to set the flags in our CPSR but I do not understand what EOR is performing.
I need help understanding, thanks in advance.