I am playing with the COMPARE AND JUMP instructions to see what range of
immediate values are accepted by the assembler.  I've written a macro
simulate the instruction with separate COMPARE/JUMP instructions for use at
sites still using older hardware.

The compare logical and jump instructions are restricted to terms in the
0-255 range which is what I had expected.
However, the [arithmetic] compare and just accepts ANY valid self defining
term, and silently truncates that value to to the rightmost 8-bits!

Examples:

00000032 ECE4 0018 7F7E          00000062    231          CIJL
R14,-129,AA999
00000038 ECE4 0015 807E          00000062    232          CIJL
R14,-128,AA999
0000003E ECE4 0012 FF7E          00000062    233          CIJL
R14,255,AA999
00000044 ECE4 000F 007E          00000062    234          CIJL
R14,256,AA999
0000004A ECE4 000C F47E          00000062    235          CIJL
R14,500,AA999
00000050 ECE4 0009 787E          00000062    236          CIJL
R14,X'12345678',AA999
00000056 0000 0000 0000          00000000    237          CIJL
R14,X'123456789',AA999
** ASMA146E Self-defining term too long or value too large -
X'123456789',AA999
** ASMA435I Record 51 in SYS12269.T191312.RA000.RXN.R1B80579 on volume:
DCIA23
0000005C ECE4 0003 F47E          00000062    238          CIJL
R14,C'1234',AA999

I think any expression value outside the range -128:255 (or even stricter,
-128:127) should be flagged by the assembler.
Would you consider this behavior a bug or a feature?


And yes, I am aware that the actual instruction does not alter the
condition code whereas my macro would.  In the transition period where use
of the macro is possible, we've specified that the condition code is
unpredictable after use of the instruction/macro.

Robert Ngan
CSC Financial Services Group

Reply via email to