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

  1. Path: sparky!uunet!wupost!darwin.sura.net!nntp.msstate.edu!emory!sol.ctr.columbia.edu!hamblin.math.byu.edu!arizona.edu!mvb.saic.com!macro32
  2. From: GAVRON@VESTA.SUNQUEST.COM
  3. Newsgroups: vmsnet.internals
  4. Subject: BxxxxW
  5. Message-ID: <920818101628.73@VESTA.SUNQUEST.COM>
  6. Date: 18 Aug 92 17:16:28 GMT
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. Lines: 83
  9. X-Gateway-Source-Info: Mailing List
  10.  
  11. Date sent:  18-AUG-1992 10:08:14
  12.  
  13.  
  14.         Jamie mentioned the use of Macros to do the branching
  15.         when destination is more than a byte away (signed of
  16.         course).
  17.  
  18.         The following is from [v55.driver.lis]dkdriver.lis:
  19.         (pretty clever code actually)
  20.  
  21.         .SBTTL  WORD_BRANCHES   - Define word displacement branches
  22. ;+
  23. ; WORD_BRANCHES
  24. ;
  25. ; This macro defines for each Bxxx (conditional branch) instruction an
  26.  equivalent
  27. ; macro named BxxxW with a word displacement. The macro takes as an argument
  28. ; a list of tuples, each tuple containing 3 items: 1) a conditional branch
  29. ; opcode; 2) the opcode with the opposite polarity; and 3) the number of
  30. ; arguments required by the opcode.
  31. ;-
  32.         .MACRO  WORD_BRANCHES LIST
  33.  
  34.         .MACRO  WORD_BRANCHES2, OPCODE1, OPCODE2, ARGCNT
  35.  
  36.         .IF EQ ARGCNT-0
  37.         .MACRO  OPCODE1, DST, ?L
  38.         OPCODE2 L
  39.         BRW     DST
  40. L:      .ENDM   OPCODE1
  41.         .ENDC
  42.  
  43.         .IF EQ ARGCNT-1
  44.         .MACRO  OPCODE1, FIELD, DST, ?L
  45.         OPCODE2 FIELD,L
  46.         BRW     DST
  47. L:      .ENDM   OPCODE1
  48.         .ENDC
  49.  
  50.         .IF EQ ARGCNT-2
  51.         .MACRO  OPCODE1, BIT, FIELD, DST, ?L
  52.         OPCODE2 BIT,FIELD,L
  53.         BRW     DST
  54. L:      .ENDM   OPCODE1
  55.         .ENDC
  56.  
  57.         .ENDM   WORD_BRANCHES2
  58.  
  59.         .MACRO  WORD_BRANCHES1, OPCODE1, OPCODE2, ARGCNT
  60.  
  61.         WORD_BRANCHES2 'OPCODE1'W, OPCODE2, ARGCNT
  62.         WORD_BRANCHES2 'OPCODE2'W, OPCODE1, ARGCNT
  63.  
  64.         .ENDM   WORD_BRANCHES1
  65.  
  66.         .IRP    ENTRY, <LIST>
  67.         WORD_BRANCHES1 ENTRY
  68.         .ENDR
  69.  
  70.         .ENDM   WORD_BRANCHES
  71.  
  72.         WORD_BRANCHES <-
  73.                 <BBC,   BBS,    2>,-
  74.                 <BBCC,  BBSC,   2>,-
  75.                 <BBCS,  BBSS,   2>,-
  76.                 <BCC,   BCS,    0>,-
  77.                 <BEQL,  BNEQ,   0>,-
  78.                 <BEQLU, BNEQU,  0>,-
  79.                 <BGEQ,  BLSS,   0>,-
  80.                 <BGEQU, BLSSU,  0>,-
  81.                 <BGTR,  BLEQ,   0>,-
  82.                 <BGTRU, BLEQU,  0>,-
  83.                 <BLBC,  BLBS,   1>,-
  84.                 <BVC,   BVS,    0>>
  85.  
  86.  
  87.  
  88.         Ehud
  89.  
  90. --
  91. Ehud Gavron        (EG76)
  92. gavron@vesta.sunquest.com
  93. "The world bores you when you're cool."
  94.