From: "Dave Clark" <dlcl...@winsupplyinc.com>
Sent: Saturday, February 12, 2022 9:44 AM
"IBM Mainframe Assembler List" <ASSEMBLER-LIST@LISTSERV.UGA.EDU> wrote on
02/11/2022 05:27:48 PM:
Thanks, we'll see how this works. ;-)
ZAP_IT ZAP PWORK16(0),0(0,R1) (SEE EXECUTE INSTRUCTION BELOW)
...snip...
LHI R2,15*16 SET LENGTH OF WORK FIELD
L R3,FLD_LENG SET LENGTH OF VAR DATA
SHI R3,1 DECREMENT FOR EXECUTE
AR R2,R3 COMBINE THE TWO
EX R2,ZAP_IT MOVE VAR DATA TO WORK FIELD
Better is
L R3,FLD_LENG
LA R3,240(0,R3)
BCTR 3,0
EX R3,ZAP_IT
or even
IC R3,FIELD_BYTE
LA R3,239(0,R3)
EX R3,ZAP_IT
If the first operand has fixed length (15), that length can be
encoded in the subject instruction, so you would need only
IC R3,FIELD-BYTE
BCTR R3,0
EX R3,ZAP_IT
In any case, safest to test FIELD_BYTE or FLD_LENG
for zero, prior to subtraction of 1.
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus