The ability to specify: IIHF R00,H'12345,0'
to insert 12345 into bytes 0-1, and zero into bytes 2-3 of register would be useful. Kludge for this is: IIHF R00,12345*65536 which is ugly, while: IIHL R00, 809041920 is even uglier! Robert Ngan -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Steve Smith Sent: Saturday, February 25, 2017 11:24 To: [email protected] Subject: Re: HLASM anomaly Exactly. HLASM is inconsistent in conflating storage types (F, H, etc.) and data types (B, X, C), which definitely adds to the confusion. C (and its derivatives) makes more sense in this regard. OTOH, C does have the interesting feature that the size of ints (and shorts and longs) and pointers can vary. PL/I might have the best model, but I haven't done any serious work with it in many years. sas On 2/25/2017 11:42, Charles Mills wrote: > Another way of looking at things is that X' serves two different roles in the > assembler syntax. I became aware of this when I moved from a long career > writing assembler to C++ as my primary language. > > X' signifies (a.) that the constant that follows is in hexadecimal notation > and (b.) a unit of storage, a byte. > > Thus you can say LHI 0,X'23' (role a.) or DC X'23' (roles a. and b.). > Consider the contrast with H' which is only a unit of storage. You can say DC > H'23' but you would not expect to be able to code LHI 0,H'23'. So, similarly, > you can code DC 2X'23' but not LHI 0,2X'23' > > FWIW and OT, C/C++ separates the two functions. 0x23 represents only the > quantity 23 base 16, not a unit of storage. You can say foo = 0x23 (roughly > analogous to LHI) but if you want to define storage, you must explicitly > state the unit of storage that you are defining: char foo = 0x23 or short foo > = 0x23 (roughly equivalent to FOO DC X'23' and FOO DC H'35' respectively). > > Charles > > CSC - This is a PRIVATE message - If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind the Company to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
