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

  1. Path: sparky!uunet!news.univie.ac.at!chx400!ira.uka.de!yale.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
  2. From: brydon@dsn.sinet.slb.com
  3. Newsgroups: vmsnet.internals
  4. Subject: Assembler wishlist
  5. Message-ID: <9211042342.AA14774@sndsu1.sinet.slb.com>
  6. Date: Wed, 4 Nov 92 23:42:25 GMT
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 34
  10.  
  11. From:   BRYDON@PSI%DSN@MRGATE@SNDRTR
  12. To:     "macro32@wkuvx1.bitnet"@M_INTERNET@MRGATE@SNDRTR@SNDRTR
  13.  
  14. Derek S. Haining (DEREK@MAX.U.WASHINGTON.EDU) says:
  15. >>        .dsect  x
  16. >>flink:  .long
  17. >>blink:  .long
  18. >>data:   .blkl   n
  19. >>bits:   .byte
  20. >>...
  21. >
  22. >I have seen this already done -- with a .PSECT $$ABS$$ declaration.  Notice
  23. >that this PSECT is based at address '00000000', and so basically generates
  24. >offsets.  Also, you can use the "BLINK = 4" construct to accomplish this.
  25.  
  26. Yes, but if you do the first trick with the $$ABS$$ stuff, aren't you really
  27. generating 'real' storage allocation?  Also, this restricts you to one DSECT,
  28. unless you do assembler directives like '.=0' repeatedly.
  29.  
  30. For the second case of "BLINK = 4", of course you can do this.  But it is the
  31. programmer's responsibility to know that a longword is 4 bytes, and to get all
  32. the offsets correct (trivial for this example, but a bit more hairy in a large
  33. program).  This is largely a  clerical task that can and should be taken care
  34. of by the assembler.  Also, a data type change of one variable in the middle
  35. of your struct/dsect causes all following offset values to change.  This
  36. currently has to be done manually, should be done by the assembler.
  37.  
  38. A DSECT directive is trivial to implement in compiler/assembler construction
  39. and saves an awful lot of programming effort.  I think it also makes more
  40. appealing and maintainable code as well.
  41. _______________________________________________________________
  42. Harvey Brydon         | Internet:   brydon@dsn.SINet.slb.com
  43. Dowell Schlumberger   | P.O.T.S.:   (918)250-4312
  44.             No main(), no brain
  45.