274 programming appendix a – Omron HOME SECURITY SYSTEM - MOTION SENSOR FQM1-MMA21 User Manual

Page 297

Advertising
background image

274

Programming

Appendix A

Operand

Description

Notation

Application examples

Specifying
an indirect
address
using a reg-
ister

Indirect
address
(No offset)

The bit or word with the memory
address contained in IR

@ will be speci-

fied.

Specify ,IR

@ to specify bits and words

for instruction operands.

,IR0

,IR1

LD ,IR0
Loads the bit with the memory address
in IR0.

MOV #0001 ,IR1
Stores #0001 in the word with the
memory address in IR1.

Constant
offset

The bit or word with the memory
address in IR

@ + or – the constant is

specified.

Specify +/– constant ,IR

@. Constant off-

sets range from –2048 to +2047 (deci-
mal). The offset is converted to binary
data when the instruction is executed.

+5,IR0

+31,IR1

LD +5 ,IR0
Loads the bit with the memory address
in IR0 + 5.

MOV #0001 +31 ,IR1
Stores #0001 in the word with the
memory address in IR1 + 31

Auto Incre-
ment

The contents of IR

@ is incremented by

+1 or +2 after referencing the value as
an memory address.

+1: Specify ,IR

@+

+2: Specify ,IR

@ + +

,IR0 ++

,IR1 +

LD ,IR0 ++
Increments the contents of IR0 by 2
after the bit with the memory address
in IR0 is loaded.

MOV #0001 ,IR1 +
Increments the contents of IR1 by 1
after #0001 is stored in the word with
the memory address in IR1.

Auto Dec-
rement

The contents of IR

@ is decremented by

–1 or –2 after referencing the value as
an memory address.

–1: Specify ,–IR

@

–2: Specify ,– –IR

@

,– –IR0

,–IR1

LD ,– –IR0
After decrementing the contents of IR0
by 2, the bit with the memory address
in IR0 is loaded.

MOV #0001 ,–IR1
After decrementing the contents of IR1
by 1, #0001 is stored in the word with
the memory address in IR1.

Data

Operand

Data form

Symbol

Range

Application example

16-bit con-
stant

All binary data or
a limited range of
binary data

Unsigned binary

#

#0000 to #FFFF

---

Signed decimal

±

–32768 to
+32767

---

Unsigned deci-
mal

&

&0 to &65535

---

All BCD data or a
limited range of
BCD data

BCD

#

#0000 to #9999

---

32-bit con-
stant

All binary data or
a limited range of
binary data

Unsigned binary

#

#00000000 to
#FFFFFFFF

---

Signed decimal

±

–2147483648 to
+2147483647

---

Unsigned deci-
mal

&

&0 to
&4294967295

---

All BCD data or a
limited range of
BCD data

BCD

#

#00000000 to
#99999999

---

Advertising