Article View: vmsnet.internals
Article #400Re: Assembler wishlist
From: Paladin
Date: Thu, 05 Nov 1992 12:39
Date: Thu, 05 Nov 1992 12:39
58 lines
2636 bytes
2636 bytes
brydon@dsn.sinet.slb.com writes:
>
>>> .dsect x
>>>flink: .long
>>>blink: .long
>>>data: .blkl n
>>>bits: .byte
>>>...
>>
>>I have seen this already done -- with a .PSECT $$ABS$$ declaration. Notice
>>that this PSECT is based at address '00000000', and so basically generates
>>offsets. Also, you can use the "BLINK = 4" construct to accomplish this.
>
>Yes, but if you do the first trick with the $$ABS$$ stuff, aren't you really
>generating 'real' storage allocation? Also, this restricts you to one DSECT,
>unless you do assembler directives like '.=0' repeatedly.
>...
>
I assume ".PSECT $$ABS$$" is a pre-defined psect that has the
"ABS" (absolute addressing) attribute set. You could define a
unique psect with this "ABS" attribute set for every structure
you want to symbolically define this way.
.PSECT STRUCTURE1 ABS, NORD, NOWRT, NOEXE, LONG
STR1.K_ELEMENTS=10
STR1.L_FLINK: .BLKL
STR1.L_BLINK: .BLKL
STR1.L_DATA: .BLKL STR1.K_ELEMENTS
STR1.B_BITS: .BLKB
STR1.K_SIZE=.
.PSECT STRUCTURE2 ABS, NORD, NOWRT, NOEXE, LONG
STR2.K_ELEMENTS=20
STR2.B_TYPE: .BLKB
STR2.B_COUNT: .BLKB
STR2.B_BITS: .BLKB
.ALIGN LONG
STR2.L_DATA: .BLKL STR2.K_ELEMENTS
STR2.K_SIZE=.
.PSECT CODE PIC, SHR, EXE, NOWRT, LONG
.ENTRY SUB,^M<R2,R3>
MOVL 4(AP),R0 ;structure 1 is first argument
MOVL 8(AP),R1 ;structure 2 is second argument
MOVL STR1.L_FLINK(R0), R2 ;Get foward link of structure 1
MOVB STR2.B_BITS(R1), R3 ;Get flag bits of structure 2
; ...
.END
The structures show up in the macro listing psect synopsis this way:
PSECT name Allocation PSECT No. Attributes
---------- ---------- --------- ----------
STRUCTURE1 00000031 ( 49.) 01 ( 1.) NOPIC ... ABS
STRUCTURE2 00000054 ( 84.) 02 ( 2.) NOPIC ... ABS
The allocation column shows you the size of the structures, but no 'real'
storage is allocated. See the description of the "ABS" psect attribute
in the Vax Macro manual to confirm this.
Technical Details
Message-ID:
<01GQSJT01GYA9FMKXO@accuwx.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!elroy.jpl.nasa.gov!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!elroy.jpl.nasa.gov!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32 From: GOODMAN@ACCUWX.COM (Paladin) Newsgroups: vmsnet.internals Subject: Re: Assembler wishlist Message-ID: <01GQSJT01GYA9FMKXO@accuwx.com> Date: 5 Nov 92 12:39:02 GMT Organization: Macro32<==>Vmsnet.Internals Gateway Lines: 58 X-Gateway-Source-Info: Mailing List