3 . I ns t r uc ti on Se t3- 4 5 1API Mnemonic Operands Function ControllersES2/EX2 SS2 SA2SESX2190 MBC P Matrix bit status countTypeOPBit Devices Word devices Program StepsX Y M S K H KnX KnY KnM KnS T C D E F MBC, MBCP: 7 stepsS * * * * * * *n * * *D * * * * * * * *PULSE 16-bit 32-bitES2/EX2 SS2 SA2SE SX2 ES2/EX2 SS2 SA2SE SX2 ES2/EX2 SS2 SA2SE SX2Operands:S: Matrix source device n: Matrix length (K1~K256) D: Operation resultExplanations:1. MBC instruction counts the number of bit 1 or bit 0 in the matrix with matrix length n and storesthe counted number in D.2. If operands S or D use KnX, KnY, KnM, KnS format, only n = 4 is applicable.3. When M1098 = ON, MBC instruction counts the number of bit 1. M1098 = OFF, MBC countsthe number of bit 0. If bits counting result is 0, M1099 = ON4. Associated flags:M1098: Counting the number of bits which are “1” or “0”M1099: ON when the bits counting result is “0”.Program Example:When X0 = ON with M1098 = ON, MBC instruction counts the number of bit 1 in D0~D2 and storethe counted number in D10. When X0 = ON with M1098 = OFF, the instruction counts the numberof bit 0 in D0~D2 and store the counted number in D10.X0MBC D0 K3 D101 1 1 1 1 10 11 1 1 1 1 10 101 1 1 1 1 10 10012111111111111111000000M1098=036 M1098=1D0D1D2D10D10