ARM v7 cortex-m assembly language question. 5. When an 8-bit or 16-bit data is l
ID: 3889242 • Letter: A
Question
ARM v7 cortex-m assembly language question.
Explanation / Answer
1. LDRSB R1,[R0]
R1= 0x-43
Explanation: LDRSB load a signed byte from the address field specified in the operand here the operand is [R0] which contains 0xC3, for a signed byte the MSB acts as sign bit if it is 1 then the number is negative, here the number is 1100 0011 which equals to -43 in hexa decimal format.
2. LDRSH R1,[R0]
R1 = 0x-42C3
Expalnation: LDRSH loads a signed halfword address field specified in the operand here the operand is [R0](LSB) which contains 0xC3,and [R0+1](MSB) contains B2 for a signed byte the MSB acts as sign bit if it is 1 then the number is negative, here the number is 1100 0010 1100 0011 which equals to -42C3 in hexa decimal format.
3. LDRB R1,[R0]
R1 = 0xC3
Explanation: LDRB loads a unsigned 8 bit value to the R1 from memory location specified in the R0. Here the R0 denoted the address location which has the value C3 in hexa decimal format.
4. LDRH R1,[R0]
R1 = 0xB2C3
Expalnation: LDRH loads a unsigned 16 bit value to R1. Since the system is little endian LSB is stored in the minimum address location, Therefore LSB = C3 and MSB is B2.
Please Rate it if you find the answer is helpful....Thanks..:)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.