11 - 11 11 - 11
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
BSWAP
Instruction
Byte SWAP
• Swaps two values in byte units.
BSWAP <variable 1> , <swap starting address of variable 1> ,
<variable 2> , <swap starting address of variable 2> , <swap count>
variable 1, variable 2
• • • •
Specify the variables to be swapped.
swap start address of
variable 1, variable 2
• • • •
Specify the swap start address of variable1 and
variable2.
Syntax
swap count
• • • •
Specify the number of items to swap in byte units.
BSWAP A%( ), 0, A%( ), 1, 1
• • • •
Swaps the upper one byte and lower one byte of
A%(0).
(0)
(1)
• •
•
C8
H
00
H
A%
Before swap
Lower one byte
Higher one byte
Lower one byte
Higher one byte
64
H
00
H
(0)
(1)
C8
H
00
H
A%
After swap
64
H
00
H
• •
•
• •
•
• •
•
BSWAP A$, 2, B%( ), 1, 2
• • • •
Swaps two bytes of character array A$(2), A$(3) and
other two bytes that are the upper one byte of the
integer array B%(0) and the lower one byte of B%(1).
Examples
After swap
(0)
(1)
B%
Lower one byte
Higher one byte
Lower one byte
Higher one byte
00
H
43
H
44
H
10
H
(0)
(1)
41
H
(A)
42
H
(B)
59
H
(Y)
50
H
(P)
(2)
(3)
A$
Before swap
(0)
(1)
B%
00
H
10
H
(0)
(1)
• •
•
41
H
(A)
42
H
(B)
(2)
(3)
A$
43
H
(C)
44
H
(D)
59
H
50
H
• •
•
• •
•
• •
•
• •
•
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...