I know the theoritical concept of DSECT.
But when we say that with DESCT no actual virtual storage is allocated, what do we mean ??? What exactly happens ???
Can any body throw some light on DSECT and its usage???
Joined: 20 Jun 2005 Posts: 86 Location: Chennai, India
Have you ever used a stencil? DSECT's exactly that.
You can place a stencil over certain data and read the data in symbolic ashion, rather than referring them via absolute displacements.
You can move the stencil over repetitive data (arrays) and read it using same variables if you know the element size.
If you have multiple data formats, you can use different stencils to read the same data, by choosing one among them at a time.
The only restriction is that you have to tell the compiler before hand which stencil you are going to use for a particular portion of the code; it doesn't matter which path your routine takes during run time; all you have to ensure is you have the right mapping for the right code.
Does that answer your question?
A DSECT is much like the LINKAGE SECTION in a COBOL program. It allows you to work with field names instead of register+disp.
DSECTs are used together with the USING statement.
As Bharanidharan said, you can simulate the cobol OCCURS statement:
LOOP EQU *
LOOP EQU *
DSFLD1 DS CL4
DSFLD2 DS CL8
The USING command means that MYDSECT describes the area pointed to by register 6.
(I don't work anymore in Assembler, so I don't have actual examples. Sorry for the infinite loop)