What does the following program do?
.data
a: .word 0x42
b: .word 0x43
c: .word 0x44
.text
sethi %hi(a), %r1
or %r1, %lo(a), %r1
ld [%r1], %r2
set b, %r1
ld [%r1], %r3
set c, %r1
ld [%r1], %r4
smul %r2, %r3, %r2
sdiv %r2, %r4, %r2
set a, %r1
st %r2, [%r1]
ta 0
Write a comment after each non-empty line.
I've done the first line for you:
.data ! place data section at default location 0x4000
For each line of code, do not restate what the instruction does,
instead try to explain (this might mean that you need to try to
understand what the program does overall so you can explain what
a single instruction contributes to that goal). (Not that the
program is really very useful... Still, make sure you can describe what
it does in one sentence.)