:>>            SLR      r0,r0                                     clear
register 2
:>>            IC       r0,str2(,r13,157)                      load the one
character into it
:>>            O        r0,=F'10995440'                     OR  this with
0x00A7C6F0'  (=F'10995440')  which is  a7=x c6=F f0=0   = X F 0
:>>            N        r0,=F'255'                               clear the
top 3 bytes .. keep the lower byte
:>>            STC      r0,str2(,r13,157)                  store the
character

So basically the code is oring the character with 0xf0 - which by luck is
what you wanted.


On Wed, 17 Aug 2022 at 10:05, Binyamin Dissen <[email protected]>
wrote:

> Quite possible.
>
> To confirm, it is '\xf0' with surrounding quotes of \xF0 without quotes. Or
> both?
>
>
> On Wed, 17 Aug 2022 09:31:18 +0200 Bernd Oppolzer <
> [email protected]>
> wrote:
>
> :>Could it be that the source has been transferred in any way?
> :>
> :>It would be valid, if there was a backslash before the hex constant,
> :>like below;
> :>backslash, followed by x, followed by two hex digits is a single char in
> C.
> :>
> :>str2 = str2 ¦ '\xF0';
> :>
> :>HTH, kind regards
> :>
> :>Bernd
> :>
> :>
> :>
> :>Am 17.08.2022 um 09:16 schrieb Binyamin Dissen:
> :>> I have inherited some C code.
> :>>
> :>>    str2 = str2 ¦ 'xF0';
> :>>    str1 = str1 >> 4;
> :>>    str1 = str1 ¦ 'xF0';
> :>>
> :>> These receive
> :>>
> :>> CCN4118 Character constant 'xF0' has more than 1 character.
> :>>
> :>> Examining the source4 it appears the intent is for 0xF0
> :>>
> :>> 1. Why would this be a mere informational message? Seems like it
> should be a
> :>> warning. that the sizes do not match.
> :>>
> :>> The code generated is
> :>>
> :>>
> :>> *    str2 = str2 ¦ 'xF0';
> :>>            SLR      r0,r0
> :>>            IC       r0,str2(,r13,157)
> :>>            O        r0,=F'10995440'
> :>>            N        r0,=F'255'
> :>>            STC      r0,str2(,r13,157)
> :>> *    str1 = str1 >> 4;
> :>>            SLR      r0,r0
> :>>            IC       r0,str1(,r13,156)
> :>>            SRA      r0,4
> :>>            N        r0,=F'255'
> :>>            STC      r0,str1(,r13,156)
> :>> *    str1 = str1 ¦ 'xF0';
> :>>            SLR      r0,r0
> :>>            IC       r0,str1(,r13,156)
> :>>            O        r0,=F'10995440'
> :>>            N        r0,=F'255'
> :>>            STC      r0,str1(,r13,156)
> :>>
> :>> 10995440 = x'A7C6F0' = 'xF0'
> :>>
> :>> 2. This is very old cold, not compiled for years (decades?). Was there
> a point
> :>> in C compiler history where 'this was ever a valid hex constant?
> :>>
> :>> --
> :>> Binyamin Dissen <[email protected]>
> :>> http://www.dissensoftware.com
> :>>
> :>> Director, Dissen Software, Bar & Grill - Israel
> :>>
> :>> ----------------------------------------------------------------------
> :>> For IBM-MAIN subscribe / signoff / archive access instructions,
> :>> send email to [email protected] with the message: INFO IBM-MAIN
> :>
> :>----------------------------------------------------------------------
> :>For IBM-MAIN subscribe / signoff / archive access instructions,
> :>send email to [email protected] with the message: INFO IBM-MAIN
>
> --
> Binyamin Dissen <[email protected]>
> http://www.dissensoftware.com
>
> Director, Dissen Software, Bar & Grill - Israel
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to