need to write an ARM assembly program which can be compiled
need to write an ARM assembly program which can be compiled by arm-elf-gcc to analyze the
 content of register r0:
 first give a value of r0(such as 100)
 then– Register r1 holds the value of r0[7:0]
 – Register r2 holds the value of r0[15:8]
 – Register r3 holds the value of r0[30:18]
 thx^_^
Solution
ARM code:
AREA Sample, CODE, READONLY
;code entry
ENTRY
;main
start
MOV r0, #100 ;move constant 100 into r0
AND r1, r0, #0x000000ff ;lower 8 bits
AND r2, r0, #0x0000ff00 ;get r0[15:8]
AND r3, r0, #0x7ffc0000 ;get r0[30:18]
END

