Digital and Embedded Systems, Bräunl 2015


In an Atmel controller, the memory and accumulator contents are initially:

[$0900] = $12, [$0056] = $24, [$0038] = $12, [R16] = $B3, [R17] = $12, [R18] = $24

What is the hex value in R16 after executing each of the following instructions separately?
(Always using the the same memory and accumulator contents as shown above)

a.

add

R16, R17

$C5

b

and

R16, R17

$12

c

or

R16, R18

$B7

d

ldi

R16, $38

$38

e

subi

R16, $12

$A1

f

sbr

R16, 7

$B7