Mikroone - Online Help
LDL R[x], k -
Loading a Constant to Low - Part of a Register
LDL R[x], Label
- Loading address of a Label to Low - Part of a Register
Operating Mode
R[x]LOW :=k
PC
:= PC + 1
Description
Saves Constant k
to Lower Byte of Register R[x].
Binary Command
15 14 13 12 11 |
10 9 8 |
7 6 5 4 3 2 1 0 |
01000 |
Adr(x) |
Constant k |
Example
LDL R[4], 12
15 14 13 12 11 |
10 9 8 |
7 6 5 4 3 2 1 0 |
01000 |
100 |
00001100 |
Note
You are able to load the address
value of a Label with the Command LDL to a register.
This is very useful for
example when using Interrupt Service Routines,
because you do not need to calculate the addresses
by yourself.
As you only can use LDL,
the addresses can not be larger than 255.
If they are larger, only
the Low-Byte is used.
So keep in mind that your
Labels are placed in the range from 0 to 255.