2.18 Assume the following register contents: X10 = 0x00000000AAAAAAAA, X11 = 0x1
ID: 2084468 • Letter: 2
Question
2.18 Assume the following register contents:
X10 = 0x00000000AAAAAAAA, X11 = 0x1234567812345678
2.18.1 [5] <§2.6> For the register values shown above, what is the value of X12
for the following sequence of instructions?
LSL X12, X10, #4
ORR X12, X12, X11
2.18.2 [5] <§2.6> For the register values shown above, what is the value of X12
for the following sequence of instructions?
LSL X12, X11, #4
2.18.3 [5] <§2.6> For the register values shown above, what is the value of X12
for the following sequence of instructions?
LSR X12, X10, #3
ANDI X12, X12, 0xFEF
Explanation / Answer
Given,
X10 = 00000000 00000000 00000000 00000000 10101010 10101010 10101010 10101010
X11 = 00010010 00110100 01010110 01111000 00010010 00110100 01010110 01111000
Ans 2.18.1) LSL X12, X10, #4 means X10 is shifted to left by 4 digits and stored in X12, i.e ,
X12 = 00000000 00000000 00000000 00001010 10101010 10101010 10101010 10100000
ORR X12, X12, X11 means (X12) OR (X11) is stored in X12, i.e ,
X12 = 00000000 00000000 00000000 00001010 10101010 10101010 10101010 10100000
OR
X11 = 00010010 00110100 01010110 01111000 00010010 00110100 01010110 01111000
gives,
X12 = 00010010 00110100 01010110 01111010 10111010 10111110 11111110 11111000
which can also be written as,
X12 = 0x1234567ABABEFEF8
Ans 2.18.2) LSL X12, X11, #4 means X11 is shifted to left by 4 digits and stored in X12, i.e ,
X11 = 00100011 01000101 01100111 10000001 00100011 01000101 01100111 10000000
which can also be written as,
X11 = 0x2345678123456780
Ans 2.18.3 LSR X12, X10, #3 means X10 is shifted to right by 3 digits and stored in X12, i.e
X12 = 00000000 00000000 00000000 00000000 00010101 01010101 01010101 01010101
ANDI X12, X12, 0xFEF means (X12) AND (0xFEF) and store in X12, i.e,
X12 = 00000000 00000000 00000000 00000000 00010101 01010101 01010101 01010101
AND
0xFEF = 00000000 00000000 00000000 00000000 00000000 00000000 00001111 11101111
Gives,
X12 = 00000000 00000000 00000000 00000000 00000000 00000000 00000101 01000101
which can also be written as,
X12 = 0x545
I hope it may help you.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.