Digital and Embedded Systems, Bräunl 2015


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

[$0400] = $16, [$0401] = $32, [$0402] = $02, [R16] = $A5, [R17] = $44, [R18] = $16

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.

lds

R16, $0400

$16

b.

add

R16, R17

$E9

c.

andi

R16, $80

$80

d

or

R16, R18

$B7

e.

inc

R16

$A6

f.

subi

R16, 2

$A3