|
I'm reposting this, as I'm not sure my first posting got there. ----- Original Message ----- From: Leif Svalgaard <leif@leif.org> To: <MI400@midrange.com> Sent: Saturday, August 26, 2000 7:18 AM Subject: Re: how to create unsigned hexadecimal initial value > From: <rjd@us.ibm.com> > > > I think even the more recent examples are easy to explain in terms of the > > definition I gave for H literals. > > CPYNV NN, -1; > > AND(S) NN,H'0003'; /* Equivalent to AND(S) NN, 3; */ > > CVTHC MSG-TEXT(1:4), XX; > > CALLI SHOW-MESSAGE, *, .SHOW-MESSAGE; <==== shows 0300 wrong > > > > H'0003' represents the value 3 and has length 1 (unlike character > > constants, the leading zeros are not significant). Based on the > > specification for AND(S), the shorter operand is padded on the right with > > zeros. So, the expected result of ANDing op1=x'FFFF' with op2=x'03' is > > x'0300'. > > In my rewriting of your definition I said: > "The length of an H literal is always 4 bytes". > That does not explain the above behavior. You suggested the asymmetrical > definition that for non-negative literals, leading zero-valued bytes be > dropped > in calculating the length. Although that would explain the behavior, I have > a semantic problem with it, as it leads to integers of length 1 or 3 which > are normally not defined (there is no BIN(1)). I also have a problem with > the value H'00'. Is that a BIN(1) or a BIN(0) value? > > Finally, your definition does not explain: > > CPYNV NN, -1; > AND(S) NN,H'0123'; /* gives 2300, WRONG */ > > +--- | This is the MI Programmers Mailing List! | To submit a new message, send your mail to MI400@midrange.com. | To subscribe to this list send email to MI400-SUB@midrange.com. | To unsubscribe from this list send email to MI400-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: dr2@cssas400.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.