That might be frought with other issues...

For example, what does this mean?

   A  EQU32  1
   B  EQU64  2
   C  EQU32  (A + B)

Is the addition of A+B conducted as a 64-bit addition or a 32-bit one?
What is the result type of that addition?  If the result type is 64-bit
what is the meaning of assigning the 64-bit value to a 32-bit value?

In this example, with the values "1" and "2" - it might not matter
too much, but what about this:

   A  EQU32  X'7FFFFFFF'
   B  EQU64  1
   C  EQU32  (A + B)

what is the value in C?  And, what would be the value of this:

   D  EQU64  (A + B)


And... then, what is the value of this:


   E EQU32 1

     ...

   E EQU64 1

My point being that in the introduction of a type system,
you have to be careful to define semantics of operations on those
types.

Typically - a type system includes:

  1) A way to create data of the type.
  2) Operations on those types.
  3) A way to destroy data of the type.

Doing only #1 doesn't really solve the problem... I don't think.

However - if you did do a type on LCL and GBL, then you are
declaring data of the type (#1) and since the definition of LCL and GBL
define when the data is destroyed, you have solved #2.  All we
need to do is define #3... some simple rules might suffice (along
the lines of something similar to C's default promotion rules???)

Something like - if either operand is 64-bits, the result is 64-bits,
otherwise the result is 32-bits.  32-bit values are sign-extended
to become 64-bit values.

The storage of a 64-bit value to a 32-bit value simply truncates,
the storage of a 32-bit value does sign-extension to the 64-value.

Just some thoughts....

        - Dave Rivers -

 
> 
> That's just what I was considering for HLASM, but we ran out of time etc.
> John Ehrman
>     (------------------ Referenced Note Follows --------------------)
> Date:    Sun, 6 Jul 2014 01:14:03 -0400
> From:    Tony Harminc <[email protected]>
> Subject: Re: HLASM doubleword set-symbol arithmetic
> 
> On 5 July 2014 11:55, Paul Gilmartin
> <[email protected]> wrote:
> > A less 'easy' alternative would be to introduce types, and associated
> > instructions: GBLA32, GBLA64, SETA32, SETA64, EQU32, EQU64, ...
> 
> If someone for some reason decided to do it this way, I'd expect GBLG,
> SETG, and so on...
> 
> Tony H.
> 


--
[email protected]                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

Reply via email to