I have certainly been accused of being a pedant, and I freely use LA as an add 
immediate instruction for constants less than 4096. I use instructions for what 
they do, not for their motivation or nomenclature. Do you find it improper to 
use UNPK for purposes other than decimal arithmetic, e.g., converting binary to 
hexadecimal for display? BCTR to decrement a register without testing it?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [[email protected]] on behalf 
of Paul Gilmartin [[email protected]]
Sent: Tuesday, February 8, 2022 10:44 AM
To: [email protected]
Subject: Re: Making Encoded Bits Human Readable

On Feb 7, 2022, at 23:10:49, Bob Raicer wrote:
>
> Just for fun, here is yet one more variation on Peter's scheme, using
> only S/360 instructions.  In the comments, YY and ZZ represent the two
> bit pairs of interest, lower case x represents bits or bytes of unknown
> value.  Bit strings are enclosed in square brackets.  Bytes are separated
> by underscore characters.
>
>          XR    R14,R14                  R14 = 00_00_00_00.
>
Is that the fastest way to clear R14 on S/360?

>     ...
>          LA    R14,X'F1'(,R14)          * Scale x'00' through x'03'
>          LA    R15,X'F1'(,R15)          * to x'F1' through x'F4'
>
Is that more transparent than:
         LA    R14,C'1'(,R14)
         LA    R15,C'1'(,R15)
???  When I'm wearing my Pascal hat I loathe arithmetic operations
on character operands.  When I wear my C hat they come naturally.

A pedant insisted (here? lately?) that LA should be used only with
operands referring to storage addresses.  I believe the rationale
is that reckless use of LA in lieu of Immediate instructions, which
have existed only recently, risks unexpected truncation to 24 bits
or 31 bits.

--
gil

Reply via email to