On Fri, 22 Aug 2025 00:27:22 +0000, Ngan, Robert <robert.n...@dxc.com> wrote:
>I noticed this too a while back (wow! 2017), >>1. The two MVHHI (move halfword immediate to halfword storage) >>instructions are setting up the edit mask. >>Note: In my code if I had to move > 2 bytes, I just define a constant. This >>code is more efficient at the expense of understandability for humans reading >>it. You're making this far more difficult than necessary. MVHHI moves exactly 1 by Here's how I would code it to improve performance and make it readable. macro , &L MOVELIT &DEST,&SOURCE AIF ('&source'(1,1) NE '''').MVC_&DEST_&SOURCE AIF (L'&DEST EQ 0).NOMOVE AIF (L'&DEST EQ 1).MVI AIF (L'&DEST EQ 2).MVHHI AIF (L'&DEST GT #).MVC_CONSTANT &L JAL R1,L&SYSNDX D&SYSNDX DC CL(L'&DEST)&SOURCE DS 0H L&SYSNDX MVC &DEST,0(R1) MEND , Your intention is to efficiently move a constant. Moving an inline constant avoids the fetch for the constant. Is using a 256 byte inline constant wise? Someone else will need to advise you on the max acceptable length and accept the cost of the fetch from the litpool.