Doubt in Array datatype



High Level Assembler(HLASM) for MVS & VM & VSE

Doubt in Array datatype

Postby nareshv_99 » Thu Feb 23, 2012 11:21 pm

hi all,
could you clarify my below doubt

consider below variable declaration

GROUP DS 0XL3
GROUP1 DS XL1
GRPVAL EQU X'AA'
GROUP2 DS CL1
GROUP3 DS CL1

so is GROUP variable an array of GROUP1,GRPVAL AND GROUP2 or GROUP1,GROUP2,GROUP3 ?

i believe it GROUP array consists of GROUP1,GROUP2(can have value of x'AA'),GROUP3. could you confirm if i'm correct?

consider below variable declaration
GROUP DS 0XL3
GROUP1 DS XL1
GROUP2 DS CL4

isn't GROUP array contains GROUP1, GROUP2,GROUP+8 ?
nareshv_99
 
Posts: 17
Joined: Sat Feb 18, 2012 3:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in Array datatype

Postby Robert Sample » Thu Feb 23, 2012 11:38 pm

Does the assembler output shed any light?
.000018                               38 GROUP    DS    0XL3
.000018                               39 GROUP1   DS    XL1
.                      000AA          40 GRPVAL   EQU   X'AA'
.000019                               41 GROUP2   DS    CL1
.00001A                               42 GROUP3   DS    CL1
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Doubt in Array datatype

Postby steve-myers » Fri Feb 24, 2012 2:36 am

There is no such thing as an "array datatype" in Assembler.

GROUP DS 0XL3

just tells the Assembler there is a storage area named GROUP, and that it is 3 bytes long, but is "repeated" 0 times. In other words it is just the start of storage. As written, it implies that the GROUP1, GROUP2 and GROUP3 are grouped together, but this is not something the Assembler does; it is for the convenience of the programmer. The Assembler makes no connection between GROUP, GROUP1, GROUP2 and GROUP3. If the programmer should insert some storage between say, GROUP2 and GROUP3, the Assembler will be perfectly happy. The program may not be perfectly happy, but that's another issue.

Something like ARRAY DS 10F sort of implies an array, but it does no such thing for the Assembler.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post