In: Computer Science
1. what mask in register F would cause the Simple Assembler instruction [and RA, RA, RF] to put 0 in the most significant bit of register A without disturbing the other bits?
2. Suppose registers E and F contained AA and CC, respectively. What bit pattern would be in register D after executing the Simple Assembler instruction [xor RD,RE,RF]?
3. Suppose registers E and F contained AA and CC, respectively. What bit pattern would be in register D after executing the Simple Assembler instruction [and RD,RE,RF]?
4. If registers 0 and 1 contain the patterns B5 and F0, respectively, what will be in register 1 after executing the Simple Assembler instruction [move R0,R1]?
Q1.
The assembler instruction [and RA, RA, RF] causes the result of the and operation between the contents of registers A and F to be stored ar Register A. Again, we know that the result of and operation of any 2 bits is 0 if either or both of the bits are 0. Thus, to put 0 in the MSB or most significant bit of register A without disturbing the other bits, most simply the MSB of register F should be made 0.
Q2.
For the Simple Assembler instruction [xor RD,RE,RF] the result of the xor of the contents of registers E and F will be stored at register D. Now, since the xor of hex AA & CC, which are contents of registers E & F respectively, is hex 66, the content of register D will be hex 66 after the instruction.
Q3.
For the Simple Assembler instruction [and RD,RE,RF] the result of the and of the contents of registers E and F will be stored at register D. Now, since the xor of hex AA & CC is hex 66,which are contents of registers E & F respectively, the content of register D will be hex 88 after the instruction.
Q3.
For the Simple Assembler instruction [and RD,RE,RF] the result of the and of the contents of registers E and F will be stored at register D. Now, since the xor of hex AA & CC is hex 66,which are contents of registers E & F respectively, the content of register D will be hex 88 after the instruction.
Q4.
The Simple Assembler instruction [move R0,R1] moves the content of register 1 to register 0. Hence, if registers 0 and 1 contain the patterns B5 and F0, respectively, the content in register 1 after executing will be blank as the content F0 of register 1 has been moved to register 0.