Ü CABxx (Compare and Branch)
·
This op-code compares
factor 1 with factor 2 and as per the condition specified by CABxx, the program
control goes to the program Label specified in the result field.
·
The Label in result
field denotes a TAG Label or a ENDSR Label.
·
xx represents EQ, GE,
GT, LE, LT, and NE.
Factor 1
|
Op-code
|
Factor 2
|
Result Field
|
Resulting Indicators
HI LO EQ
|
Comparison value 1
|
CABxx
|
Comparison value 2
|
TAG Label or a ENDSR Label
|
Factor1>Factor2
|
Factor1
|
Factor1=Factor2
|
Example
Columns . . . : 6 80 Edit AMINEM/QRPGLESRC
SEU==> OP_CABXX
FMT D DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 Da S 2 0 INZ(11) 130128
0002.00 Db S 2 0 INZ(22) 130128
0003.00 Dc S 2 0 INZ(11) 130128
0004.00 Dn S 2 0 INZ(0) 130128
0005.00 C TAG_A TAG 130128
0006.00 C a CABEQ c TAG01 130128
0007.00 * 130128
0008.00 C TAG_B TAG 130128
0009.00 C b CAB c TAG02 414243 130128
0010.00 * 130128
0011.00 C TAG01 TAG 130128
0012.00 C EVAL n=n+1 130128
0013.00 C GOTO TAG_B 130128
0014.00 * 130128
0015.00 C TAG02 TAG 130128
0016.00 C EVAL n=n+1 130128
0017.00 C n DSPLY 130128
0018.00 C *IN41 DSPLY 130128
0019.00 C *IN42 DSPLY 130128
0020.00 C *IN43 DSPLY 130128
0021.00 * 130128
0022.00 C SETON LR 130128
****************** End of data *******************************************************
OUTPUT
DSPLY 2
DSPLY 1
DSPLY 0
DSPLY 0