home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / vmsnet / internal / 1543 < prev    next >
Encoding:
Internet Message Format  |  1992-11-05  |  2.5 KB

  1. Path: sparky!uunet!olivea!decwrl!elroy.jpl.nasa.gov!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
  2. From: GOODMAN@ACCUWX.COM (Paladin)
  3. Newsgroups: vmsnet.internals
  4. Subject: Re: Assembler wishlist
  5. Message-ID: <01GQSJT01GYA9FMKXO@accuwx.com>
  6. Date: 5 Nov 92 12:39:02 GMT
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. Lines: 58
  9. X-Gateway-Source-Info: Mailing List
  10.  
  11. brydon@dsn.sinet.slb.com writes:
  12. >
  13. >>>        .dsect  x
  14. >>>flink:  .long
  15. >>>blink:  .long
  16. >>>data:   .blkl   n
  17. >>>bits:   .byte
  18. >>>...
  19. >>
  20. >>I have seen this already done -- with a .PSECT $$ABS$$ declaration.  Notice
  21. >>that this PSECT is based at address '00000000', and so basically generates
  22. >>offsets.  Also, you can use the "BLINK = 4" construct to accomplish this.
  23. >
  24. >Yes, but if you do the first trick with the $$ABS$$ stuff, aren't you really
  25. >generating 'real' storage allocation?  Also, this restricts you to one DSECT,
  26. >unless you do assembler directives like '.=0' repeatedly.
  27. >...
  28. >
  29.  
  30. I assume ".PSECT $$ABS$$" is a pre-defined psect that has the
  31. "ABS" (absolute addressing) attribute set.  You could define a
  32. unique psect with this "ABS" attribute set for every structure
  33. you want to symbolically define this way.
  34.  
  35.         .PSECT  STRUCTURE1      ABS, NORD, NOWRT, NOEXE, LONG
  36. STR1.K_ELEMENTS=10
  37. STR1.L_FLINK:   .BLKL
  38. STR1.L_BLINK:   .BLKL
  39. STR1.L_DATA:    .BLKL STR1.K_ELEMENTS
  40. STR1.B_BITS:    .BLKB
  41. STR1.K_SIZE=.
  42.  
  43.         .PSECT  STRUCTURE2      ABS, NORD, NOWRT, NOEXE, LONG
  44. STR2.K_ELEMENTS=20
  45. STR2.B_TYPE:    .BLKB
  46. STR2.B_COUNT:   .BLKB
  47. STR2.B_BITS:    .BLKB
  48.         .ALIGN  LONG
  49. STR2.L_DATA:    .BLKL STR2.K_ELEMENTS
  50. STR2.K_SIZE=.
  51.  
  52.         .PSECT  CODE    PIC, SHR, EXE, NOWRT, LONG
  53.         .ENTRY  SUB,^M<R2,R3>
  54.         MOVL    4(AP),R0                ;structure 1 is first argument
  55.         MOVL    8(AP),R1                ;structure 2 is second argument
  56.         MOVL    STR1.L_FLINK(R0), R2    ;Get foward link of structure 1
  57.         MOVB    STR2.B_BITS(R1), R3     ;Get flag bits of structure 2
  58. ;       ...
  59.         .END
  60.  
  61. The structures show up in the macro listing psect synopsis this way:
  62. PSECT name                      Allocation          PSECT No.  Attributes
  63. ----------                      ----------          ---------  ----------
  64. STRUCTURE1                      00000031  (   49.)  01 (  1.)  NOPIC ... ABS
  65. STRUCTURE2                      00000054  (   84.)  02 (  2.)  NOPIC ... ABS
  66. The allocation column shows you the size of the structures, but no 'real'
  67. storage is allocated.  See the description of the "ABS" psect attribute
  68. in the Vax Macro manual to confirm this.
  69.