Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
On 12/7/22 10:01:33, Steve Smith wrote: "The second operand is two bytes in length and is treated as a 16-bit signed binary integer." So, I think it's just a bug. I haven't had occasion to use -1 with CHSI, etc., but I have with MVHI, etc. and no such warning is emitted. It appears that HLASM needs a cast-like facility so a programmer could code, as in C: (signed short)0x -- gil
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
On Wed, 7 Dec 2022 at 14:28, Ed Jaffe wrote: > On 12/7/2022 9:12 AM, Gord Tomlin wrote: > > > > Maybe replace CLHHSI with CHHSI, which is designed for signed values: > > Duh! I would have suggested that myself had I read PoOp more carefully... > > Thanks, Gord! > But if you're doing a mass change of CLCs with numeric literals, you'll need a smarter parser. If you're just changing these as you're working nearby, then sure. Tony H.
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
On 12/7/2022 9:12 AM, Gord Tomlin wrote: Maybe replace CLHHSI with CHHSI, which is designed for signed values: Duh! I would have suggested that myself had I read PoOp more carefully... Thanks, Gord! -- Phoenix Software International Edward E. Jaffe Chief Technology Officer 831 Parkview Drive North El Segundo, CA 90245 https://www.phoenixsoftware.com/ This e-mail message, including any attachments, appended messages and the information contained therein, is for the sole use of the intended recipient(s). If you are not an intended recipient or have otherwise received this email message in error, any use, dissemination, distribution, review, storage or copying of this e-mail message and the information contained therein is strictly prohibited. If you are not an intended recipient, please contact the sender by reply e-mail and destroy all copies of this email message and do not otherwise utilize or retain this email message or any or all of the information contained therein. Although this email message and any attachments or appended messages are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the sender for any loss or damage arising in any way from its opening or use.
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
That text is for, e.g., compare halfword immediate (CHHSI), not for CLHHSI. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Steve Smith [sasd...@gmail.com] Sent: Wednesday, December 7, 2022 12:01 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance "The second operand is two bytes in length and is treated as a 16-bit signed binary integer." So, I think it's just a bug. I haven't had occasion to use -1 with CHSI, etc., but I have with MVHI, etc. and no such warning is emitted. sas On Wed, Dec 7, 2022 at 11:20 AM Seymour J Metz wrote: > When you code an immediate operand, it has semantics beyond the generated > code. An operand of -1 is signed and not equivalent to X'', even though > they have the same value. The instruction is compare logical half half > storage immediate, thus the assembler expects the immediate operand to be > unsigned. I'd consider the message to be appropriate. > > Maybe define a symbol with an appropriate and use it in the CLHHSI, e.g., > > HWMINUS1ASUNSIGNED EQU X'' > > > -- > Shmuel (Seymour J.) Metz > http://mason.gmu.edu/~smetz3 > > > From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on > behalf of Ed Jaffe [edja...@phoenixsoftware.com] > Sent: Wednesday, December 7, 2022 10:46 AM > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU > Subject: CLHHSI TYPECHECK(MAGNITUDE) Annoyance > > We decided to replace many SS instructions with their SIL counterparts. > One common case is frustrating. > > D501 C01E C020 CLC HWord,=H'-1'Is it negative one? > A784 000C JENegOne Branch if yes > > replaced with: > > E555 C01E CLHHSI HWord,-1 Is it negative one? > A784 000C JENegOne Branch if yes > ** ASMA320W Immediate field operand may have incorrect sign or magnitude > - -1 > > I totally understand the warning in this case: > > E555 C01E CLHHSI HWord,131071 Is it negative one? > A784 000C JENegOne Branch if yes > ** ASMA320W Immediate field operand may have incorrect sign or magnitude > - 131071 > > but I can't understand why -1 generates this warning. The provided value > is validly within the range -32768 through 32767. > > We like TYPECHECK(MAGNITUDE) and quite literally assemble tens of > millions of lines of code daily with it enabled and no such warnings are > produced. So we're forced to use ACONTROL like this around this bizarre > case: > > PUSH ACONTROL > ACONTROL TYPECHECK(NOMAGNITUDE) > E555 C01E CLHHSI HWord,-1 Is it negative one? > A784 000C JENegOne Branch if yes > POP ACONTROL > > It seems a ridiculous misunderstanding on the part of the assembler... > > -- > Phoenix Software International > Edward E. Jaffe > 831 Parkview Drive North > El Segundo, CA 90245 > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.phoenixsoftware.com%2Fdata=05%7C01%7Csmetz3%40gmu.edu%7C4027c12c5a6f425383b908dad874ca40%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638060293405108598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=vs8hxUTdP3pLOLnVeOUmxjA2t0abEyQg9fMMukG%2FLnU%3Dreserved=0 > > > > > This e-mail message, including any attachments, appended messages and the > information contained therein, is for the sole use of the intended > recipient(s). If you are not an intended recipient or have otherwise > received this email message in error, any use, dissemination, distribution, > review, storage or copying of this e-mail message and the information > contained therein is strictly prohibited. If you are not an intended > recipient, please contact the sender by reply e-mail and destroy all copies > of this email message and do not otherwise utilize or retain this email > message or any or all of the information contained therein. Although this > email message and any attachments or appended messages are believed to be > free of any virus or other defect that might affect any computer system > into > which it is received and opened, it is the responsibility of the recipient > to ensure that it is virus free and no responsibility is accepted by the > sender for any loss or damage arising in any way from its opening or use. >
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
On 2022-12-07 10:46 AM, Ed Jaffe wrote: We decided to replace many SS instructions with their SIL counterparts. One common case is frustrating. D501 C01E C020 CLC HWord,=H'-1' Is it negative one? A784 000C JE NegOne Branch if yes replaced with: E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JE NegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - -1 I totally understand the warning in this case: E555 C01E CLHHSI HWord,131071 Is it negative one? A784 000C JE NegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - 131071 but I can't understand why -1 generates this warning. The provided value is validly within the range -32768 through 32767. We like TYPECHECK(MAGNITUDE) and quite literally assemble tens of millions of lines of code daily with it enabled and no such warnings are produced. So we're forced to use ACONTROL like this around this bizarre case: PUSH ACONTROL ACONTROL TYPECHECK(NOMAGNITUDE) E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JE NegOne Branch if yes POP ACONTROL It seems a ridiculous misunderstanding on the part of the assembler... Maybe replace CLHHSI with CHHSI, which is designed for signed values: D501 D146 D144 01E6 01E4111 CLC HWORD,=H'-1' A784 FFE5 0114112 JEEXIT E555 D146 01E6 113 CLHHSI HWORD,-1 ** ASMA320W Immediate field operand may have incorrect sign or magnitude - -1 A784 FFE0 0114114 JEEXIT E554 D146 01E6 115 CHHSI HWORD,-1 A784 FFDB 0114116 JEEXIT -- Regards, Gord Tomlin Action Software International (a division of Mazda Computer Corporation) Tel: (905) 470-7113, Fax: (905) 470-6507 Support: https://actionsoftware.com/support/
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
Ooops. Missed that you were using the CL* version. No such thing as negative numbers in logical land. sas On Wed, Dec 7, 2022 at 12:00 PM Ed Jaffe wrote: > On 12/7/2022 8:20 AM, Seymour J Metz wrote: > > When you code an immediate operand, it has semantics beyond the > generated code. An operand of -1 is signed and not equivalent to X'', > even though they have the same value. The instruction is compare logical > half half storage immediate, thus the assembler expects the immediate > operand to be unsigned. I'd consider the message to be appropriate. > > > > Maybe define a symbol with an appropriate and use it in the CLHHSI, e.g., > > > > HWMINUS1ASUNSIGNED EQU X'' > > > Yes, an EQUate should work. Perhaps something like UHNeg1 which is not > syntactically longer than =H'-1' used to be. > > > -- > Phoenix Software International > Edward E. Jaffe > 831 Parkview Drive North > El Segundo, CA 90245 > https://www.phoenixsoftware.com/ > > > > > This e-mail message, including any attachments, appended messages and the > information contained therein, is for the sole use of the intended > recipient(s). If you are not an intended recipient or have otherwise > received this email message in error, any use, dissemination, distribution, > review, storage or copying of this e-mail message and the information > contained therein is strictly prohibited. If you are not an intended > recipient, please contact the sender by reply e-mail and destroy all copies > of this email message and do not otherwise utilize or retain this email > message or any or all of the information contained therein. Although this > email message and any attachments or appended messages are believed to be > free of any virus or other defect that might affect any computer system > into > which it is received and opened, it is the responsibility of the recipient > to ensure that it is virus free and no responsibility is accepted by the > sender for any loss or damage arising in any way from its opening or use. >
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
"The second operand is two bytes in length and is treated as a 16-bit signed binary integer." So, I think it's just a bug. I haven't had occasion to use -1 with CHSI, etc., but I have with MVHI, etc. and no such warning is emitted. sas On Wed, Dec 7, 2022 at 11:20 AM Seymour J Metz wrote: > When you code an immediate operand, it has semantics beyond the generated > code. An operand of -1 is signed and not equivalent to X'', even though > they have the same value. The instruction is compare logical half half > storage immediate, thus the assembler expects the immediate operand to be > unsigned. I'd consider the message to be appropriate. > > Maybe define a symbol with an appropriate and use it in the CLHHSI, e.g., > > HWMINUS1ASUNSIGNED EQU X'' > > > -- > Shmuel (Seymour J.) Metz > http://mason.gmu.edu/~smetz3 > > > From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on > behalf of Ed Jaffe [edja...@phoenixsoftware.com] > Sent: Wednesday, December 7, 2022 10:46 AM > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU > Subject: CLHHSI TYPECHECK(MAGNITUDE) Annoyance > > We decided to replace many SS instructions with their SIL counterparts. > One common case is frustrating. > > D501 C01E C020 CLC HWord,=H'-1'Is it negative one? > A784 000C JENegOne Branch if yes > > replaced with: > > E555 C01E CLHHSI HWord,-1 Is it negative one? > A784 000C JENegOne Branch if yes > ** ASMA320W Immediate field operand may have incorrect sign or magnitude > - -1 > > I totally understand the warning in this case: > > E555 C01E CLHHSI HWord,131071 Is it negative one? > A784 000C JENegOne Branch if yes > ** ASMA320W Immediate field operand may have incorrect sign or magnitude > - 131071 > > but I can't understand why -1 generates this warning. The provided value > is validly within the range -32768 through 32767. > > We like TYPECHECK(MAGNITUDE) and quite literally assemble tens of > millions of lines of code daily with it enabled and no such warnings are > produced. So we're forced to use ACONTROL like this around this bizarre > case: > > PUSH ACONTROL > ACONTROL TYPECHECK(NOMAGNITUDE) > E555 C01E CLHHSI HWord,-1 Is it negative one? > A784 000C JENegOne Branch if yes > POP ACONTROL > > It seems a ridiculous misunderstanding on the part of the assembler... > > -- > Phoenix Software International > Edward E. Jaffe > 831 Parkview Drive North > El Segundo, CA 90245 > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.phoenixsoftware.com%2Fdata=05%7C01%7Csmetz3%40gmu.edu%7Cb8e9bc93878545f5d50608dad86a6896%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638060248795037186%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=nSiNwQLluMEbqXVV7FtvNW%2BoB3oVZmxt%2BQcNN%2Fmlc7k%3Dreserved=0 > > > > > This e-mail message, including any attachments, appended messages and the > information contained therein, is for the sole use of the intended > recipient(s). If you are not an intended recipient or have otherwise > received this email message in error, any use, dissemination, distribution, > review, storage or copying of this e-mail message and the information > contained therein is strictly prohibited. If you are not an intended > recipient, please contact the sender by reply e-mail and destroy all copies > of this email message and do not otherwise utilize or retain this email > message or any or all of the information contained therein. Although this > email message and any attachments or appended messages are believed to be > free of any virus or other defect that might affect any computer system > into > which it is received and opened, it is the responsibility of the recipient > to ensure that it is virus free and no responsibility is accepted by the > sender for any loss or damage arising in any way from its opening or use. >
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
On 12/7/2022 8:20 AM, Seymour J Metz wrote: When you code an immediate operand, it has semantics beyond the generated code. An operand of -1 is signed and not equivalent to X'', even though they have the same value. The instruction is compare logical half half storage immediate, thus the assembler expects the immediate operand to be unsigned. I'd consider the message to be appropriate. Maybe define a symbol with an appropriate and use it in the CLHHSI, e.g., HWMINUS1ASUNSIGNED EQU X'' Yes, an EQUate should work. Perhaps something like UHNeg1 which is not syntactically longer than =H'-1' used to be. -- Phoenix Software International Edward E. Jaffe 831 Parkview Drive North El Segundo, CA 90245 https://www.phoenixsoftware.com/ This e-mail message, including any attachments, appended messages and the information contained therein, is for the sole use of the intended recipient(s). If you are not an intended recipient or have otherwise received this email message in error, any use, dissemination, distribution, review, storage or copying of this e-mail message and the information contained therein is strictly prohibited. If you are not an intended recipient, please contact the sender by reply e-mail and destroy all copies of this email message and do not otherwise utilize or retain this email message or any or all of the information contained therein. Although this email message and any attachments or appended messages are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the sender for any loss or damage arising in any way from its opening or use.
Re: CLHHSI TYPECHECK(MAGNITUDE) Annoyance
When you code an immediate operand, it has semantics beyond the generated code. An operand of -1 is signed and not equivalent to X'', even though they have the same value. The instruction is compare logical half half storage immediate, thus the assembler expects the immediate operand to be unsigned. I'd consider the message to be appropriate. Maybe define a symbol with an appropriate and use it in the CLHHSI, e.g., HWMINUS1ASUNSIGNED EQU X'' -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Ed Jaffe [edja...@phoenixsoftware.com] Sent: Wednesday, December 7, 2022 10:46 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: CLHHSI TYPECHECK(MAGNITUDE) Annoyance We decided to replace many SS instructions with their SIL counterparts. One common case is frustrating. D501 C01E C020 CLC HWord,=H'-1'Is it negative one? A784 000C JENegOne Branch if yes replaced with: E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JENegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - -1 I totally understand the warning in this case: E555 C01E CLHHSI HWord,131071 Is it negative one? A784 000C JENegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - 131071 but I can't understand why -1 generates this warning. The provided value is validly within the range -32768 through 32767. We like TYPECHECK(MAGNITUDE) and quite literally assemble tens of millions of lines of code daily with it enabled and no such warnings are produced. So we're forced to use ACONTROL like this around this bizarre case: PUSH ACONTROL ACONTROL TYPECHECK(NOMAGNITUDE) E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JENegOne Branch if yes POP ACONTROL It seems a ridiculous misunderstanding on the part of the assembler... -- Phoenix Software International Edward E. Jaffe 831 Parkview Drive North El Segundo, CA 90245 https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.phoenixsoftware.com%2Fdata=05%7C01%7Csmetz3%40gmu.edu%7Cb8e9bc93878545f5d50608dad86a6896%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638060248795037186%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=nSiNwQLluMEbqXVV7FtvNW%2BoB3oVZmxt%2BQcNN%2Fmlc7k%3Dreserved=0 This e-mail message, including any attachments, appended messages and the information contained therein, is for the sole use of the intended recipient(s). If you are not an intended recipient or have otherwise received this email message in error, any use, dissemination, distribution, review, storage or copying of this e-mail message and the information contained therein is strictly prohibited. If you are not an intended recipient, please contact the sender by reply e-mail and destroy all copies of this email message and do not otherwise utilize or retain this email message or any or all of the information contained therein. Although this email message and any attachments or appended messages are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the sender for any loss or damage arising in any way from its opening or use.
CLHHSI TYPECHECK(MAGNITUDE) Annoyance
We decided to replace many SS instructions with their SIL counterparts. One common case is frustrating. D501 C01E C020 CLC HWord,=H'-1' Is it negative one? A784 000C JE NegOne Branch if yes replaced with: E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JE NegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - -1 I totally understand the warning in this case: E555 C01E CLHHSI HWord,131071 Is it negative one? A784 000C JE NegOne Branch if yes ** ASMA320W Immediate field operand may have incorrect sign or magnitude - 131071 but I can't understand why -1 generates this warning. The provided value is validly within the range -32768 through 32767. We like TYPECHECK(MAGNITUDE) and quite literally assemble tens of millions of lines of code daily with it enabled and no such warnings are produced. So we're forced to use ACONTROL like this around this bizarre case: PUSH ACONTROL ACONTROL TYPECHECK(NOMAGNITUDE) E555 C01E CLHHSI HWord,-1 Is it negative one? A784 000C JE NegOne Branch if yes POP ACONTROL It seems a ridiculous misunderstanding on the part of the assembler... -- Phoenix Software International Edward E. Jaffe 831 Parkview Drive North El Segundo, CA 90245 https://www.phoenixsoftware.com/ This e-mail message, including any attachments, appended messages and the information contained therein, is for the sole use of the intended recipient(s). If you are not an intended recipient or have otherwise received this email message in error, any use, dissemination, distribution, review, storage or copying of this e-mail message and the information contained therein is strictly prohibited. If you are not an intended recipient, please contact the sender by reply e-mail and destroy all copies of this email message and do not otherwise utilize or retain this email message or any or all of the information contained therein. Although this email message and any attachments or appended messages are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the sender for any loss or damage arising in any way from its opening or use.