Initializing and copying variables -
simple high level programming statements in assembler:
b = 4 and
b = a
Initializing variables with some value
The assignment statement:
b = 4 (or any other value)
is executed
by the computer as
follows:
You first
move the value 4
(or any other value)
into
a (unused) register
using a
mov
(if the value is small) or
the
movw and
movt instructions
(this will work with any value)
Then you
move (= store) the
value in the
register to the
(memory) variable b
(= the memory location(s)
given by the
memory address marked by the
label b)
Then you
move (= store) the
value in the
register to the
(memory) variable b
(= the memory location(s)
given by the
memory address marked by the
label b)