Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 24 of 60

SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual: SECTION 5 Instruction Set, pages 209 to 218

Pages 209 to 218 of 520, from SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual

The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Omron CQM1-CPU21

Page 209

Section

Instruction Tables

5-6

5-6-2 CPM1/CPM1A Function Codes The following table lists the CPM1/CPM1A instructions that have fixed function codes. Each instruction is listed by mnemonic and by instruction name. Use the numbers in the leftmost column as the left digit and the number in the column heading as the right digit of the function code. Right digit

Left digit

0

1

2

3

4

5

6

7

8

0

NOP NO OPERATION

END END

IL INTERLOCK

ILC INTERLOCK CLEAR

JMP JUMP

JME JUMP END

(@) FAL FAILURE ALARM AND RESET

FALS SEVERE FAILURE ALARM

STEP STEP DEFINE

SNXT STEP START

9

1

SFT SHIFT REGISTER

KEEP KEEP

CNTR REVERSIBLE COUNTER

DIFU DIFFERENTIATE UP

DIFD DIFFERENTIATE DOWN

TIMH HIGHSPEED TIMER

(@) WSFT WORD SHIFT

(@) ASFT ASYNCHRONOUS SHIFT REGISTER

---

---

2

CMP COMPARE

(@) MOV MOVE

(@) MVN MOVE NOT

(@) BIN BCD TO BINARY

(@) BCD BINARY TO BCD

(@) ASL SHIFT LEFT

(@) ASR SHIFT RIGHT

(@) ROL ROTATE LEFT

(@) ROR ROTATE RIGHT

(@) COM COMPLEMENT

3

(@) ADD BCD ADD

(@) SUB BCD SUBTRACT

(@) MUL BCD MULTIPLY

(@) DIV BCD DIVIDE

(@) ANDW LOGICAL AND

(@) ORW LOGICAL OR

(@) XORW EXCLUSIVE OR

(@) XNRW EXCLUSIVE NOR

(@) INC INCREMENT

(@) DEC DECREMENT

4

(@) STC SET CARRY

(@) CLC CLEAR CARRY

---

---

---

---

(@) MSG MESSAGE DISPLAY

---

---

---

5

(@) ADB BINARY ADD

(@) SBB BINARY SUBTRACT

(@) MLB BINARY MULTIPLY

(@) DVB BINARY DIVIDE

(@) ADDL DOUBLE BCD ADD

(@) SUBL DOUBLE BCD SUBTRACT

(@) MULL DOUBLE BCD MULTIPLY

(@) DIVL DOUBLE BCD DIVIDE

---

---

6

CMPL DOUBLE COMPARE

(@) INI MODE CONTROL

(@) PRV HIGHSPEED COUNTER PV READ

(@) CTBL COMPARISON TABLE LOAD

---

---

---

(@) BCNT BIT COUNTER

(@) BCMP BLOCK COMPARE

(@) STIM INTERVAL TIMER

7

(@) XFER BLOCK TRANSFER

(@) BSET BLOCK SET

---

(@) XCHG DATA EXCHANGE

(@) SLD ONE DIGIT SHIFT LEFT

(@) SRD ONE DIGIT SHIFT RIGHT

(@) MLPX 4-TO-16 DECODER

(@) DMPX 16-TO-4 ENCODER

(@) SDEC 7-SEGMENT DECODER

---

8

(@) DIST SINGLE WORD DISTRIBUTE

(@) COLL DATA COLLECT

(@) MOVB MOVE BIT

(@) MOVD MOVE DIGIT

(@) SFTR REVERSIBLE SHIFT REGISTER

(@) TCMP TABLE COMPARE

(@) ASC ASCII CONVERT

---

---

(@) INT INTERRUPT CONTROL

9

---

(@) SBS SUBROUTINE ENTRY

SBN SUBROUTINE DEFINE

RET SUBROUTINE RETURN

---

---

---

(@) IORF I/O REFRESH

---

(@) MCRO MACRO

191

Page 210

Section

Instruction Tables

5-6

5-6-3 SRM1 Function Codes The following table lists the SRM1 instructions that have fixed function codes. Each instruction is listed by mnemonic and by instruction name. Use the numbers in the leftmost column as the left digit and the number in the column heading as the right digit of the function code. Right digit

Left digit

5

6

7

8

0

NOP NO OPERATION

END END

IL INTERLOCK

ILC INTERLOCK CLEAR

JMP JUMP

JME JUMP END

(@) FAL FAILURE ALARM AND RESET

FALS SEVERE FAILURE ALARM

STEP STEP DEFINE

SNXT STEP START

1

SFT SHIFT REGISTER

KEEP KEEP

CNTR REVERSIBLE COUNTER

DIFU DIFFERENTIATE UP

DIFD DIFFERENTIATE DOWN

TIMH HIGHSPEED TIMER

(@) WSFT WORD SHIFT

(@) ASFT ASYNCHRONOUS SHIFT REGISTER

---

---

2

CMP COMPARE

(@) MOV MOVE

(@) MVN MOVE NOT

(@) BIN BCD TO BINARY

(@) BCD BINARY TO BCD

(@) ASL SHIFT LEFT

(@) ASR SHIFT RIGHT

(@) ROL ROTATE LEFT

(@) ROR ROTATE RIGHT

(@) COM COMPLEMENT

3

(@) ADD BCD ADD

(@) SUB BCD SUBTRACT

(@) MUL BCD MULTIPLY

(@) DIV BCD DIVIDE

(@) ANDW LOGICAL AND

(@) ORW LOGICAL OR

(@) XORW EXCLUSIVE OR

(@) XNRW EXCLUSIVE NOR

(@) INC INCREMENT

(@) DEC DECREMENT

4

(@) STC SET CARRY

(@) CLC CLEAR CARRY

---

---

---

---

(@) MSG MESSAGE DISPLAY

---

---

---

5

(@) ADB BINARY ADD

(@) SBB BINARY SUBTRACT

(@) MLB BINARY MULTIPLY

(@) DVB BINARY DIVIDE

(@) ADDL DOUBLE BCD ADD

(@) SUBL DOUBLE BCD SUBTRACT

(@) MULL DOUBLE BCD MULTIPLY

(@) DIVL DOUBLE BCD DIVIDE

---

---

6

CMPL DOUBLE COMPARE

---

---

---

---

---

---

(@) BCNT BIT COUNTER

(@) BCMP BLOCK COMPARE

(@) STIM INTERVAL TIMER

7

(@) XFER BLOCK TRANSFER

(@) BSET BLOCK SET

---

(@) XCHG DATA EXCHANGE

(@) SLD ONE DIGIT SHIFT LEFT

(@) SRD ONE DIGIT SHIFT RIGHT

(@) MLPX 4-TO-16 DECODER

(@) DMPX 16-TO-4 ENCODER

(@) SDEC 7-SEGMENT DECODER

---

8

(@) DIST SINGLE WORD DISTRIBUTE

(@) COLL DATA COLLECT

(@) MOVB MOVE BIT

(@) MOVD MOVE DIGIT

(@) SFTR REVERSIBLE SHIFT REGISTER

(@) TCMP TABLE COMPARE

(@) ASC ASCII CONVERT

---

---

---

9

---

(@) SBS SUBROUTINE ENTRY

SBN SUBROUTINE DEFINE

RET SUBROUTINE RETURN

---

---

---

(@) IORF I/O REFRESH

---

(@) MCRO MACRO

192

0

1

2

3

4

9

Page 211

Section

Instruction Tables

5-6

5-6-4 Alphabetic List by Mnemonic Dashes (“–”) in the Code column indicate expansion instructions, which do not have fixed function codes. “None” indicates instructions for which function codes are not used. Mnemonic

Code

Words

Name

CPU Units

Page

7SEG

88

4

7-SEGMENT DISPLAY OUTPUT

CQM1 only

345

ACC (@)

––

4

ACCELERATION CONTROL

CQM-CPU43-E/-EV1 only

334

ADB (@)

50

4

BINARY ADD

All

289

ADBL (@)

––

4

DOUBLE BINARY ADD only

293

ADD (@)

30

4

BCD ADD

All

278

ADDL (@)

54

4

DOUBLE BCD ADD

All

284

AND

None

1

AND

All

196

AND LD

None

1

AND LOAD

All

197

AND NOT

None

1

AND NOT

All

196

ANDW (@) 34

4

LOGICAL AND

All

309

APR (@)

––

4

ARITHMETIC PROCESS

CQM1 only

305

ASC (@)

86

4

ASCII CONVERT

All

262

ASFT(@)

17

4

ASYNCHRONOUS SHIFT REGISTER

All

230

ASL (@)

25

2

ARITHMETIC SHIFT LEFT

All

225

ASR (@)

26

2

ARITHMETIC SHIFT RIGHT

All

226

AVG

––

4

AVERAGE VALUE

CQM1 only

302

BCD (@)

24

3

BINARY TO BCD

All

253

BCDL (@)

59

3

DOUBLE BINARY-TO-DOUBLE BCD

CQM1 only

254

BCMP (@)

68

4

BLOCK COMPARE

All

244

BCNT (@)

67

4

BIT COUNTER

All

320

BIN (@)

23

3

BCD-TO-BINARY

All

252

BINL (@)

58

3

DOUBLE BCD-TO-DOUBLE BINARY

CQM1 only

254

BSET (@)

71

4

BLOCK SET

All

234

CLC (@)

41

1

CLEAR CARRY

All

278

CMP

20

3

COMPARE

All

242

CMPL

60

4

DOUBLE COMPARE

All

246

CNT

None

2

COUNTER

All

210

CNTR

12

3

REVERSIBLE COUNTER

All

211

COLL (@)

81

4

DATA COLLECT

All

237

COLM(@)

––

4

LINE TO COLUMN

CQM1 only

274

COM (@)

29

2

COMPLEMENT

All

308

CPS

––

4

SIGNED BINARY COMPARE only

248

CPSL

––

4

DOUBLE SIGNED BINARY COMPARE only

249

CTBL(@)

63

4

COMPARISON TABLE LOAD

All

215

DBS (@)

––

4

SIGNED BINARY DIVIDE only

298

DBSL (@)

––

4

DOUBLE SIGNED BINARY DIVIDE only

299

DEC (@)

39

2

BCD DECREMENT

All

312

DIFD

14

2

DIFFERENTIATE DOWN

All

200

DIFU

13

2

DIFFERENTIATE UP

All

200

DIST (@)

80

4

SINGLE WORD DISTRIBUTE

All

235

DIV (@)

33

4

BCD DIVIDE

All

282

DIVL (@)

57

4

DOUBLE BCD DIVIDE

All

287

DMPX (@)

77

4

16-TO-4 ENCODER

All

257

DSW

87

4

DIGITAL SWITCH

CQM1 only

346

193

Page 212

Section

Instruction Tables Mnemonic

Code

Words

DVB (@)

53

4

BINARY DIVIDE

All

292

END

01

1

END

All

201

FAL (@)

06

2

FAILURE ALARM AND RESET

All

205

FALS

07

2

SEVERE FAILURE ALARM

All

205

FCS (@)

––

4

FCS CALCULATE

CQM1/SRM1 only

321

FPD

––

4

FAILURE POINT DETECT

CQM1 only

322

HEX (@)

––

4

ASCII-TO-HEXADECIMAL

CQM1/SRM1 only

263

HKY

––

4

HEXADECIMAL KEY INPUT

CQM1 only

347

HMS

––

4

SECONDS TO HOURS

CQM1 only

272

IL

02

1

INTERLOCK

All

201

ILC

03

1

INTERLOCK CLEAR

All

201

INC (@)

38

2

INCREMENT

All

311

INI (@)

61

4

MODE CONTROL

All

220

INT (@)

89

4

INTERRUPT CONTROL

All

326

IORF (@)

97

3

I/O REFRESH

All

318

JME

05

2

JUMP END

All

203

JMP

04

2

JUMP

All

203

KEEP

11

2

KEEP

All

199

LD

None

1

LOAD

All

196

LD NOT

None

1

LOAD NOT

All

196

LINE

––

4

LINE

CQM1 only

273

MAX (@)

––

4

FIND MAXIMUM

CQM1 only

300

MBS (@)

––

4

SIGNED BINARY MULTIPLY only

296

MBSL (@)

––

4

DOUBLE SIGNED BINARY MULTIPLY only

297

MCMP (@) 19

4

MULTI-WORD COMPARE

CQM1 only

301

MCRO (@) 99

4

MACRO

All

319

MIN (@)

––

4

FIND MINIMUM

CQM1 only

301

MLB (@)

52

4

BINARY MULTIPLY

All

291

MLPX (@)

76

4

4-TO-16 DECODER

All

255

MOV (@)

21

3

MOVE

All

232

MOVB (@)

82

4

MOVE BIT

All

239

MOVD (@)

83

4

MOVE DIGIT

All

240

MSG (@)

46

2

MESSAGE

All

317

MUL (@)

32

4

BCD MULTIPLY

All

281

MULL (@)

56

4

DOUBLE BCD MULTIPLY

All

286

MVN (@)

22

3

MOVE NOT

All

232

NEG (@)

––

4

2’S COMPLEMENT only

275

NEGL (@)

––

4

DOUBLE 2’S COMPLEMENT only

276

NOP

00

1

NO OPERATION

All

201

OR

None

1

OR

All

196

OR LD

None

1

OR LOAD

All

197

OR NOT

None

1

OR NOT

All

196

ORW (@)

35

4

LOGICAL OR

All

309

OUT

None

2

OUTPUT

All

197

OUT NOT

None

2

OUTPUT NOT

All

197

PID

––

4

PID CONTROL only

338

PLS2 (@)

––

4

PULSE OUTPUT

CQM1-CPU43-E/-EV1 only

332

PRV (@)

62

4

HIGH-SPEED COUNTER PV READ

All

221

194

Name

CPU Units

5-6 Page

Page 213

Section

Instruction Tables Name

CPU Units

5-6

Mnemonic

Code

Words

Page

PULS (@)

65

4

SET PULSES

CQM1 and CPM1A-CDT/CDT1 only

328

PWM (@)

––

4

PULSE WITH VARIABLE DUTY RATIO

CQM1-CPU43-E/-EV1 only

336

RET

93

1

SUBROUTINE RETURN

All

315

ROL (@)

27

2

ROTATE LEFT

All

226

ROOT (@)

72

3

SQUARE ROOT

CQM1 only

288

ROR (@)

28

2

ROTATE RIGHT

All

227

RSET

None

2

RESET

All

198

RXD (@)

47

4

RECEIVE

CQM1/SRM1 only

340

SBB (@)

51

4

BINARY SUBTRACT

All

290

SBBL (@)

––

4

DOUBLE BINARY SUBTRACT only

294

SBN

92

2

SUBROUTINE DEFINE

All

315

SBS (@)

91

2

SUBROUTINE ENTRY

All

313

SCL (@)

66

4

SCALING

CQM1 only

266

SCL2 (@)

––

4

SIGNED BINARY TO BCD SCALING only

268

SCL3 (@)

––

4

BCD TO SIGNED BINARY SCALING only

269

SDEC (@)

78

4

7-SEGMENT DECODER

All

259

SEC

––

4

HOURS TO SECONDS

CQM1 only

271

SET

None

2

SET

All

198

SFT

10

3

SHIFT REGISTER

All

224

SFTR (@)

84

4

REVERSIBLE SHIFT REGISTER

All

229

SLD (@)

74

3

ONE DIGIT SHIFT LEFT

All

228

SNXT

09

2

STEP START

All

206

SPED (@)

64

4

SPEED OUTPUT

CQM1 and CPM1A-CDT/CDT1 only

330

SRCH (@)

––

4

DATA SEARCH

CQM1 only

337

SRD (@)

75

3

ONE DIGIT SHIFT RIGHT

All

228

STC (@)

40

1

SET CARRY

All

278

STEP

08

2

STEP DEFINE

All

206

STIM (@)

69

4

INTERVAL TIMER

All

213

STUP

––

3

CHANGE RS-232C SETUP

SRM1 only

344

SUB (@)

31

4

BCD SUBTRACT

All

279

SUBL (@)

55

4

DOUBLE BCD SUBTRACT

All

285

SUM (@)

––

4

SUM

CQM1 only

303

TCMP (@)

85

4

TABLE COMPARE

All

243

TIM

None

2

TIMER

All

209

TIMH

15

3

HIGH-SPEED TIMER

All

212

TKY (@)

18

4

TEN KEY INPUT

CQM1 only

347

TRSM

45

1

TRACE MEMORY SAMPLE only

315

TXD (@)

48

4

TRANSMIT

CQM1/SRM1 only

342

WSFT (@)

16

3

WORD SHIFT

All

225

XCHG (@)

73

3

DATA EXCHANGE

All

235

XFER (@)

70

4

BLOCK TRANSFER

All

233

XFRB (@)

––

4

TRANSFER BITS only

241

XNRW (@)

37

4

EXCLUSIVE NOR

All

311

XORW (@) 36

4

EXCLUSIVE OR

All

310

ZCP

––

4

AREA RANGE COMPARE only

250

ZCPL

––

4

DOUBLE AREA RANGE COMPARE only

252

195

Page 214

Section

Ladder Diagram Instructions

5-7

5-7

Ladder Diagram Instructions Ladder diagram instructions include ladder instructions and logic block instructions and correspond to the conditions on the ladder diagram. Logic block instructions are used to relate more complex parts.

5-7-1 LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT Ladder Symbols

Operand Data Areas

B

B: Bit

LOAD – LD

IR, SR, AR, HR, TC, LR, TR

B: Bit

B

LOAD NOT – LD NOT

IR, SR, AR, HR, TC, LR

B: Bit

B

AND – AND IR, SR, AR, HR, TC, LR

B: Bit

B

AND NOT – AND NOT

IR, SR, AR, HR, TC, LR

B: Bit

OR – OR

B

OR NOT – OR NOT

B

IR, SR, AR, HR, TC, LR

B: Bit IR, SR, AR, HR, TC, LR

Limitations

There is no limit to the number of any of these instructions, or restrictions in the order in which they must be used, as long as the memory capacity of the PC is not exceeded.

Description

These six basic instructions correspond to the conditions on a ladder diagram. As described in Section 4 Ladder-diagram Programming, the status of the bits assigned to each instruction determines the execution conditions for all other instructions. Each of these instructions and each bit address can be used as many times as required. Each can be used in as many of these instructions as required. The status of the bit operand (B) assigned to LD or LD NOT determines the first execution condition. AND takes the logical AND between the execution condition and the status of its bit operand; AND NOT, the logical AND between the execution condition and the inverse of the status of its bit operand. OR takes the logical OR between the execution condition and the status of its bit operand; OR NOT, the logical OR between the execution condition and the inverse of the status of its bit operand.

Flags

196

There are no flags affected by these instructions.

Page 215

Section

Bit Control Instructions

5-8

5-7-2 AND LOAD and OR LOAD AND LOAD – AND LD Ladder Symbol

00000

00002

00001

00003

OR LOAD – OR LD 00000

00001

00002

00003

Ladder Symbol

Description

When instructions are combined into blocks that cannot be logically combined using only OR and AND operations, AND LD and OR LD are used. Whereas AND and OR operations logically combine a bit status and an execution condition, AND LD and OR LD logically combine two execution conditions, the current one and the last unused one. In order to draw ladder diagrams, it is not necessary to use AND LD and OR LD instructions, nor are they necessary when inputting ladder diagrams directly, as is possible from the SSS. They are required, however, to convert the program to and input it in mnemonic form. In order to reduce the number of programming instructions required, a basic understanding of logic block instructions is required. For an introduction to logic blocks, refer to 4-3-6 Logic Block Instructions.

Flags

There are no flags affected by these instructions.

5-8

Bit Control Instructions There are seven instructions that can be used generally to control individual bit status. These are OUT, OUT NOT, DIFU(13), DIFD(14), SET, RSET, and KEEP(11). These instructions are used to turn bits ON and OFF in different ways.

5-8-1 OUTPUT and OUTPUT NOT – OUT and OUT NOT OUTPUT – OUT

Ladder Symbol

Operand Data Areas B: Bit B

OUTPUT NOT – OUT NOT

Ladder Symbol

IR, SR, AR, HR, LR, TR

Operand Data Areas B: Bit B

IR, SR, AR, HR, LR

Limitations

Any output bit can generally be used in only one instruction that controls its status.

Description

OUT and OUT NOT are used to control the status of the designated bit according to the execution condition.

197

Page 216

Section

Bit Control Instructions

5-8

OUT turns ON the designated bit for an ON execution condition, and turns OFF the designated bit for an OFF execution condition. With a TR bit, OUT appears at a branching point rather than at the end of an instruction line. Refer to 4-3-8 Branching Instruction Lines for details. OUT NOT turns ON the designated bit for a OFF execution condition, and turns OFF the designated bit for an ON execution condition. OUT and OUT NOT can be used to control execution by turning ON and OFF bits that are assigned to conditions on the ladder diagram, thus determining execution conditions for other instructions. This is particularly helpful and allows a complex set of conditions to be used to control the status of a single work bit, and then that work bit can be used to control other instructions. The length of time that a bit is ON or OFF can be controlled by combining the OUT or OUT NOT with TIM. Refer to Examples under 5-15-1 TIMER – TIM for details.

Flags

There are no flags affected by these instructions.

5-8-2 SET and RESET – SET and RSET Ladder Symbols

Operand Data Areas

SET B

B: Bit IR, SR, AR, HR, LR

RSET B

B: Bit IR, SR, AR, HR, LR

Description

SET turns the operand bit ON when the execution condition is ON, and does not affect the status of the operand bit when the execution condition is OFF. RSET turns the operand bit OFF when the execution condition is ON, and does not affect the status of the operand bit when the execution condition is OFF. The operation of SET differs from that of OUT because the OUT instruction turns the operand bit OFF when its execution condition is OFF. Likewise, RSET differs from OUT NOT because OUT NOT turns the operand bit ON when its execution condition is OFF.

Precautions

The status of operand bits for SET and RSET programmed between IL(02) and ILC(03) or JMP(04) and JME(05) will not change when the interlock or jump condition is met (i.e., when IL(02) or JMP(04) is executed with an OFF execution condition).

Flags

There are no flags affected by these instructions.

Examples

The following examples demonstrate the difference between OUT and SET/ RSET. In the first example (Diagram A), IR 10000 will be turned ON or OFF whenever IR 00000 goes ON or OFF.

198

Page 217

Section

Bit Control Instructions

5-8

In the second example (Diagram B), IR 10000 will be turned ON when IR 00001 goes ON and will remain ON (even if IR 00001 goes OFF) until IR 00002 goes ON.

00000 10000

Diagram A

Address

Instruction

00000 00001

LD OUT

Address

Instruction

00000 00001 00002 00003

LD SET LD RSET

Operands 00000 10000

00001 SET 10000 00002 RSET 10000

Diagram B

Operands 00001 10000 00002 10000

5-8-3 KEEP – KEEP(11) Ladder Symbol

Operand Data Areas S

B: Bit

KEEP(11) B R

IR, SR, AR, HR, LR

Limitations

Any output bit can generally be used in only one instruction that controls its status.

Description

KEEP(11) is used to maintain the status of the designated bit based on two execution conditions. These execution conditions are labeled S and R. S is the set input; R, the reset input. KEEP(11) operates like a latching relay that is set by S and reset by R. When S turns ON, the designated bit will go ON and stay ON until reset, regardless of whether S stays ON or goes OFF. When R turns ON, the designated bit will go OFF and stay OFF until reset, regardless of whether R stays ON or goes OFF. The relationship between execution conditions and KEEP(11) bit status is shown below.

S execution condition R execution condition

Status of B

Flags

There are no flags affected by this instruction.

199

Page 218

Section

Bit Control Instructions Precautions

5-8

Exercise caution when using a KEEP reset line that is controlled by an external normally closed device. Never use an input bit in an inverse condition on the reset (R) for KEEP(11) when the input device uses an AC power supply. The delay in shutting down the PC’s DC power supply (relative to the AC power supply to the input device) can cause the designated bit of KEEP(11) to be reset. This situation is shown below. Input Unit A

S KEEP(11)

NEVER

B

A R

Bits used in KEEP are not reset in interlocks. Refer to the 5-11 INTERLOCK – and INTERLOCK CLEAR IL(02) and ILC(03) for details.

5-8-4 DIFFERENTIATE UP and DOWN – DIFU(13) and DIFD(14) Ladder Symbols

Operand Data Areas

DIFU(13) B

B: Bit IR, SR, AR, HR, LR

DIFD(14) B

B: Bit IR, SR, AR, HR, LR

Limitations

Any output bit can generally be used in only one instruction that controls its status.

Description

DIFU(13) and DIFD(14) are used to turn the designated bit ON for one cycle only. Whenever executed, DIFU(13) compares its current execution with the previous execution condition. If the previous execution condition was OFF and the current one is ON, DIFU(13) will turn ON the designated bit. If the previous execution condition was ON and the current execution condition is either ON or OFF, DIFU(13) will either turn the designated bit OFF or leave it OFF (i.e., if the designated bit is already OFF). The designated bit will thus never be ON for longer than one cycle, assuming it is executed each cycle (see Precautions, below). Whenever executed, DIFD(14) compares its current execution with the previous execution condition. If the previous execution condition was ON and the current one is OFF, DIFD(14) will turn ON the designated bit. If the previous execution condition was OFF and the current execution condition is either ON or OFF, DIFD(14) will either turn the designated bit OFF or leave it OFF. The designated bit will thus never be ON for longer than one cycle, assuming it is executed each cycle (see Precautions, below). These instructions are used when differentiated instructions (i.e., those prefixed with an @) are not available and single-cycle execution of a particular instruction is desired. They can also be used with non-differentiated forms of instructions that have differentiated forms when their use will simplify programming. Examples of these are shown below.

Flags

200

There are no flags affected by these instructions.