Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
11 Applied Instructions (Data Operation)
11.3 ENCO / Encode
234
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (ENCO, ENCOP)
The 2
n
bit of the data specified by is encoded, and the result value is stored to the device specified by
.
This instruction converts data into binary data according to a bit position in the ON status.
1) When the device specified by is a bit device (1 n 8)
ON bit positions among "2
n
" bits (1 n 8) from the device specified by are encoded to the device
specified by .
- When "n" is "8", the device specified by occupies 2
8
= 256 bits (which is the maximum value).
- The encoding result of the device specified by is all "0" (OFF) from the most significant bit to the
low-order bit "n".
2) When the device specified by is a word device (1 n 4)
ON bit positions among "2n" bits (1 n 4) from a device specified by are encoded to the device
specified by .
- The encoding result of the device specified by is all "0" (OFF) from the most significant bit to the
low-order bit "n".
1100000000000000
b15 D10
1)2)4
All of them are "0"
b0
7
0 0 0 0 1 0 0 0
0123)456
M17 M16 M15 M14 M13 M12 M11 M10
When "n" is 3
=M10
s
d
ENCO
EN
s
n
ENO
d
when it is Y, M or S
(1n8)
Command input
Number of bits
Encoded data Resulting data
When it is T, C, D, R, U
\G
, V or Z
0001000010101010
b15
All of them are "0"
b0
1100000000000000
b15
1)2)4
b0
0123)456
7
Ignored
s
d
2
n
= 8 (when n is 3)
D0
D2
ENCO
EN
s
n
ENO
d
(1n4)
Command input
Number of bits
Encoded data Resulting data