Constants - Omron CP1E CPU UNIT SOFTWARE User Manual

Cp1e cpu unit software
Table of Contents

Advertisement

4 Understanding Programming
4-4

Constants

Overview
Constants are numeric values expressed in 16 or 32 bits and can be specified as instruction operands.
The following types of constants are supported.
• Bit Strings or Numeric Values (Integers)
Decimal values (with & symbol), hexadecimal values (with # symbol), BCD values (with # symbol), or
signed decimal values (with + or - symbol)
• Operands Specifying Numbers
Decimal Notation (No Symbol)
• Floating Point (Real Number) Notation
Signed decimal notation (with + or - symbol and decimal point)
Notation and Ranges
Using Operands for Bit Strings or Numeric Values (Integers)
Unsigned Binary
Data type
Notation
Application
example
Precautions for
correct use
Range 16 bits
32 bits
4-16
Decimal values
With & symbol
&
10
Decimal value
(integer)
Decimal symbol
MOV &10 D0
Stores 10 decimal (#000A hex) in D0.
• An error will occur and the left bus bar
will be displayed in red if a hexadecimal
value including A to F is input with &
from the CX-Programmer.
• The input will be treated as an address
in the CIO Area and the contents of that
address will be specified if a decimal
value without & is input from the CX-
Programmer.
&0 to 65535
&0 to 4294967295
Hexadecimal values
With # symbol
#
000A
Hexadecimal value
using 0 to F
Hexadecimal symbol
MOV #000A D0
Stores #000A hex (&10 decimal) in D0.
• An error will occur and the left bus bar will be
displayed in red if a hexadecimal value
including A to F is input without # from the
CX-Programmer.
• The input will be treated as an address in the
CIO Area and the contents of that address
will be specified if a decimal value without #
is input from the CX-Programmer.
#0000 to #FFFF
#00000000 to #FFFFFFFF
CP1E CPU Unit Software User's Manual(W480)

Advertisement

Table of Contents
loading

Table of Contents