Article View: vmsnet.internals
Article #395RE: Assembler wishlist
From: Hunter Goatley
Date: Thu, 05 Nov 1992 01:37
Date: Thu, 05 Nov 1992 01:37
45 lines
2367 bytes
2367 bytes
brydon@dsn.sinet.slb.com writes:
>
>>> .dsect x
>>>flink: .long
>>>blink: .long
>>>data: .blkl n
>>>bits: .byte
>>>...
[...]
>For the second case of "BLINK = 4", of course you can do this. But it is the
>programmer's responsibility to know that a longword is 4 bytes, and to get all
>the offsets correct (trivial for this example, but a bit more hairy in a large
>program). This is largely a clerical task that can and should be taken care
>of by the assembler. Also, a data type change of one variable in the middle
>of your struct/dsect causes all following offset values to change. This
>currently has to be done manually, should be done by the assembler.
>
Not if you use the $DEFINI macro, found in SYS$LIBRARY:STARLET.MLB.
Of course, $DEFINI does the .PSEC $ABS$ and the resetting of ".". But
it does it all transparently to the programmer (this is from my
LOGIN.MAR):
;
; Define symbolic offsets for the 7 word array returned by the system service
; $NUMTIM.
;
$DEFINI TIM ; Structure for $NUMTIM buffer
$DEF TIM_W_YEAR .BLKW 1 ; 7 words: Year
$DEF TIM_W_MONTH .BLKW 1 ; .... Month
$DEF TIM_W_DAY .BLKW 1 ; .... Day
$DEF TIM_W_HOUR .BLKW 1 ; .... Hour
$DEF TIM_W_MINUTE .BLKW 1 ; .... Minute
$DEF TIM_W_SECOND .BLKW 1 ; .... Second
$DEF TIM_W_HUNDRED .BLKW 1 ; .... Hundredths
$DEFEND TIM
Any of the .BLKx storage directives can be used; changing one in the
middle automatically causes the others to change.
Unless I'm missing something, this should do what you want.
Hunter
------
Hunter Goatley, VMS Systems Programmer, Western Kentucky University
goathunter@WKUVX1.BITNET, 502-745-5251
Technical Details
Message-ID:
<00963201.025242E0.31458@WKUVX1.BITNET>Path:
arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!chx400!ira.uka.de!sol.ctr.columbia.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!chx400!ira.uka.de!sol.ctr.columbia.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32 From: Hunter Goatley <goathunter@WKUVX1.BITNET> Newsgroups: vmsnet.internals Subject: RE: Assembler wishlist Message-ID: <00963201.025242E0.31458@WKUVX1.BITNET> Date: Wed, 04 Nov 1992 19:37:22 CST Organization: Macro32<==>Vmsnet.Internals Gateway X-Gateway-Source-Info: Mailing List Lines: 45