How would you write assembly instructions to store two immediate 32-bit constant
ID: 669076 • Letter: H
Question
How would you write assembly instructions to store two immediate 32-bit constants, 0xEA and 0x00BA 0000 at memory locations 0x4000 0000 and 0x4000 0004, and 0x0011 2332 and 0x8927 1600, at memory locations 0x4000 0008 and 0x4000 000C.
Use assembler directive DCD to allocate memory for two 32-bit numbers,0x5264 7780 and 0x1525 3394, so that they will be placed right after your instruction code in the memory. Use ARM instructions to copy the two 32-bit numbers into consecutive memory locations starting at 0x4000 0010 and 0x4000 0014.
Explanation / Answer
1)
mov r1,0xEF
st r1,[0x40000000]
mov $r1,0x00BA0000
st r1,[0x40000004]
2)
mov r1,0x0011 2332
st r1,[0x40000008]
mov r1,0x8927 1600
st r1,[0x4000000C]
3)
mov r1,0x5264 7780
st r1,[0x40000010]
mov r1,0x1525 3394
st r1,[0x40000014]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.