Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

2017-03-21 Thread Steve Smith
On Mon, Mar 20, 2017 at 9:14 PM, Steve Thompson  wrote:

> On 03/20/2017 07:45 PM, Steve Smith wrote:
>
>> Two's-complement is an amazingly great way for binary computers to store
>> negative numbers.  It is not so great for humans to read or write.
>>
> 
>
> ...
>
> So, don't be so hasty to shoot down two's complement.
>

I hardly did any such thing.  I should have added two's-complement is an
amazingly great way to *process* negative numbers.  It's almost magic.
Thanks to two's-complement, the only difference between signed & logical
addition & subtraction is how the condition code is set.

>
> ...
> However, you could, if you really wanted to, ORG back over the instruction
> and stick whatever it is you want in the Immediate Byte(s). But don't
> forget to also code " ORG , " after you do this just to keep from screwing
> the instruction counter...
>
That's been mentioned before.  However, a bare "ORG ," should be used with
caution.  Especially in a macro, there's the possibility that a previous
ORG has already placed you further back than you know.

>
> Regards,
> Steve Thompson
>



-- 
sas


Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

2017-03-20 Thread Steve Thompson

On 03/20/2017 07:45 PM, Steve Smith wrote:

Two's-complement is an amazingly great way for binary computers to store
negative numbers.  It is not so great for humans to read or write.



I have worked on a One's complement machine. As I recall (it has 
been more than 35 years since I was programming a Univac 1100 
machine) Two's complement prevents a "math/logic" error. And I 
just can't remember for sure what it was. It may have been that 
-0 could be a "valid" result when doing one's complement.


So, don't be so hasty to shoot down two's complement.

And in many places were I have worked on IBM and Wang VS systems, 
the standards required packed decimal except for Indexes, so that 
numbers could be read in a dump.


Me being an ALC programmer, didn't care because I had a trusty TI 
Programmer, or the equivalent from Casio, so I could decode Fixed 
point binary as well as Float.


Now, I'm going to sit back and eat some more pop-corn while you 
guys argue this thing out.


But I still think the way we have been doing things is the right 
way to handle it.


However, you could, if you really wanted to, ORG back over the 
instruction and stick whatever it is you want in the Immediate 
Byte(s). But don't forget to also code " ORG , " after you do 
this just to keep from screwing the instruction counter...


Regards,
Steve Thompson


Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

2017-03-20 Thread Steve Smith
Two's-complement is an amazingly great way for binary computers to store
negative numbers.  It is not so great for humans to read or write.  First
of all, you have to know where the sign bit is, and X expressions are
ambiguous.  If you watch carefully, you'll see that HLASM (almost) always
left-fills to 32 bits (with 0s), so if you intend to specify -1, then you
must write X''.

It would have been nice if different conventions were chosen back in the
dark ages, instead of conflating X strings with hex numbers.  But it isn't
nice, and you might as well learn how it works, and learn to live with it.

HLASM has much historical baggage. C'est la vie.

sas

On Mon, Mar 20, 2017 at 3:53 PM, Charles Mills <charl...@mcn.org> wrote:

> I fail to see how making the two similar constant parsers more identical
> is an obscene parody of some other language.
>
> FWIW, I am not a young-un. I am competent in assembler -- my first
> professional language -- and now quite competent in C++. I am not a
> religious bigot. Each language has its place. I am writing assembler at the
> moment -- it's better suited to the task at hand. (Well, writing an e-mail
> at this very moment ...)
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
> On Behalf Of John Walker
> Sent: Monday, March 20, 2017 11:46 AM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)
>
> That is so, isn't it.  And now, as fewer and fewer true assembler
> programmers are found, more and more C or C++ or Java programmers will seek
> to distort Assembler into some obscene parody of their favorite language.
>  If IBM allows this, it will make life for real Assembler programmers more
> difficult as they have to relearn AND recode old Assembler code to fit into
> the C/C++/Java paradigms.  I grant that the young-uns don't like Assembler,
> but I still can't accept the unnecessary change solely because 'old =
> unacceptable' among the children.
>



-- 
sas


Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

2017-03-20 Thread Charles Mills
I fail to see how making the two similar constant parsers more identical is an 
obscene parody of some other language.

FWIW, I am not a young-un. I am competent in assembler -- my first professional 
language -- and now quite competent in C++. I am not a religious bigot. Each 
language has its place. I am writing assembler at the moment -- it's better 
suited to the task at hand. (Well, writing an e-mail at this very moment ...)

Charles


-Original Message-
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of John Walker
Sent: Monday, March 20, 2017 11:46 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

That is so, isn't it.  And now, as fewer and fewer true assembler programmers 
are found, more and more C or C++ or Java programmers will seek to distort 
Assembler into some obscene parody of their favorite language.   If IBM allows 
this, it will make life for real Assembler programmers more difficult as they 
have to relearn AND recode old Assembler code to fit into the C/C++/Java 
paradigms.  I grant that the young-uns don't like Assembler, but I still can't 
accept the unnecessary change solely because 'old = unacceptable' among the 
children. 


Re: ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

2017-03-20 Thread John Walker
That is so, isn't it.  And now, as fewer and fewer true assembler programmers 
are found, more and more C or C++ or Java programmers will seek to distort 
Assembler into some obscene parody of their favorite language.   If IBM allows 
this, it will make life for real Assembler programmers more difficult as they 
have to relearn AND recode old Assembler code to fit into the C/C++/Java 
paradigms.  I grant that the young-uns don't like Assembler, but I still can't 
accept the unnecessary change solely because 'old = unacceptable' among the 
children. 

On Sunday, March 19, 2017 11:00 PM, ASSEMBLER-LIST automatic digest system 
 wrote:
 

 ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)#yiv8430315785 
body {font-family:Arial, Helvetica, 
sans-serif;font-size:12px;color:#00;}#yiv8430315785 td {font-family:Arial, 
Helvetica, sans-serif;font-size:12px;color:#00;}#yiv8430315785 p 
{font-family:Arial, Helvetica, 
sans-serif;font-size:12px;color:#00;}#yiv8430315785 a {font-family:Arial, 
Helvetica, 
sans-serif;font-size:12px;font-weight:bold;color:#3366CC;text-decoration:none;}#yiv8430315785
 h2 {font-family:Arial, Helvetica, 
sans-serif;font-size:17px;font-weight:bold;color:#CC0033;}#yiv8430315785 h3 
{font-family:Arial, Helvetica, 
sans-serif;font-size:16px;font-weight:bold;color:#3366CC;}
|  |  |   |



| 
| 
ASSEMBLER-LIST Digest - 18 Mar 2017 to 19 Mar 2017 (#2017-31)

Table of contents:
   
   - HLASM "Anomaly" (2)
   
   
   - HLASM "Anomaly"  
  - Re: HLASM "Anomaly" (03/19)  
From: Abe Kornelis 
  - Re: HLASM "Anomaly" (03/19)  
From: MELVYN MALTZ 

 |

 |



| Browse the ASSEMBLER-LIST online archives. |  |

Paul,

To my mind, X'' is also -1, which is in the halfword range.

Thus it merits a warning as the assembler cannot know whether the
X'' value of H5 is intended to be signed or unsigned.
Neither should it make any assumptions. So I'm entirely
fine with HLASM accepting the value and using it, while
issuing a warning. It does what it is told to do, but it might
not be what the programmer intended it to do ;-)

Abe Kornelis
===

Op 18-3-2017 om 23:21 schreef Paul Gilmartin:
> Compare this with LHI 1,H5 and the next which generate a warning (do
> we need the warning ?)
> Yes, since X'' is 65535, and not in the halfword range, -32768 to +32767.
>

To: Abe and Paul,

Abe is quite right, when I started this thread I didn't realise just how 
many "anomalies" would pop out of the woodwork

LHI 1,X''
LHI 1,X'12345678'

Yes, you get a warning about the 2nd but not the 1st
As Abe said, I would also be drawn to the Programmer's intent, did they mean 
to code LGFI ?

Melvyn.

- Original Message - 
From: "Paul Gilmartin" <0014e0e4a59b-dmarc-requ...@listserv.uga.edu>
To: 
Sent: Saturday, March 18, 2017 10:21 PM
Subject: Re: HLASM "Anomaly"


On 2017-03-18, at 15:41, MELVYN MALTZ wrote:
>
> A fine example is LHI 1,H2 and the next
> Both of these assemble without error or warning (that's a big disagree)
>
Don't you believe -1 is a valid expression to LHI?  Or don't
you believe X'' is -1?

Remember, expressions are typeless.  Would you change that?  How?
That requires a lot of wise design.  What types should exist?  What
types should be allowed to be combined with what operators?

Too much of HLASM came about because someone thought some construct
worked the way he expected and twisted an account rep's arm to make
it so, and didn't care about the chaos this added to the specification.

> Compare this with LHI 1,H5 and the next which generate a warning (do we 
> need the warning ?)
>
Yes, since X'' is 65535, and not in the halfword range, -32768 to 
+32767.

> - Original Message - From: "Paul Gilmartin"
> Sent: Saturday, March 18, 2017 2:10 PM
> Subject: Re: HLASM "Anomaly"
>
> For which of these intructions do you agree/disagree with
> HLASM's behavior:
>    ...
> H2      EQU  X''
>        LHI  1,H2
>        LHI  1,X''
>        DC    Y(H2)
>        DC    Y(X'')
>    ...
> H5      EQU  X''
>        LHI  1,H5
>        LHI  1,0+X''
>        DC    Y(H5)
>        DC    Y(X'')

-- gil