home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / vmsnet / internal / 1167 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.1 KB

  1. Path: sparky!uunet!dmc.com!munroe
  2. From: munroe@dmc.com (Dick Munroe)
  3. Newsgroups: vmsnet.internals
  4. Subject: Re: Help on image checking macro using wildcards
  5. Message-ID: <1992Aug19.065021.4449@dmc.com>
  6. Date: 19 Aug 92 06:50:21 EDT
  7. References: <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>,<1992Aug16.092754.629@cmkrnl.com> <Bt5JKF.HJn@news.cso.uiuc.edu>
  8. Organization: Doyle, Munroe Consultants, Inc., Hudson, MA
  9. Lines: 32
  10.  
  11. In article <Bt5JKF.HJn@news.cso.uiuc.edu>, mako@uihepa.hep.uiuc.edu ("Makoto Shimojima, Univ of Tsukuba/CDF") writes:
  12. >> btw, all conditional branch instructions use byte-sized displacments.  So
  13. >> most of us who code in Macro have developed a set of macros for doing
  14. >> conditional branches with word-sized branch displacements
  15. > Has someone coded a macro that would automatically choose the optimal
  16. > instruction depending on the range of the displacement? I mean something
  17. > like BLSSU_X that would turn out to be BLSSU/BLSSU_W/BLSSU_L if the
  18. > displacement is 1 byte/word/longword? I once tried it using .NTYPE (I
  19. > think that was what I used) but that did not work correctly when the
  20. > destination was undefined at the time the macro was expanded...
  21.  
  22. The problem is that the actual branch distance isn't known until pass 2 (if the
  23. references are forward).  In this case, you need to reserve the maximum amount
  24. of space for any branch code (using NOPs or you can just jam the PC counter for
  25. the psect).  Then for each branch that works, you generate the branch code,
  26. make sure that all of your cases know how much space needed to be reserved and
  27. adjust themselves appropriately and generate NOPs or a branch to the end of the
  28. allocated space.  In short, it's a mess, doable, but a mess.
  29.  
  30. If you DON'T do this, you wind up with phase errors if the actual branch
  31. instruction(s) wind up being different between passes 1 and 2 of the assembler. 
  32.  
  33. Dick Munroe
  34. -- 
  35. Dick Munroe                Internet: munroe@dmc.com
  36. Doyle Munroe Consultants, Inc.        UUCP: ...uunet!thehulk!munroe
  37. 267 Cox St.                Office: (508) 568-1618
  38. Hudson, Ma.                FAX: (508) 562-1133
  39.  
  40. GET CONNECTED!!! Send mail to info@dmc.com to find out about DMConnection.
  41.