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

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!wupost!sdd.hp.com!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!infopiz!cmkrnl!jeh
  2. Newsgroups: vmsnet.internals
  3. Subject: Re: Help on image checking macro using wildcards
  4. Message-ID: <1992Aug16.092754.629@cmkrnl.com>
  5. From: jeh@cmkrnl.com
  6. Date: 16 Aug 92 09:27:54 PDT
  7. References: <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>
  8. Organization: Kernel Mode Consulting, San Diego, CA
  9. Lines: 58
  10.  
  11. In article <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>,
  12.  CORDELKJ@UCBEH.SAN.UC.EDU writes:
  13. > in the following routine can I use wildcards?
  14. >
  15. > ;++
  16. > ; Check for protected image
  17. > ;
  18. > ; Delete following 3 lines to remove protected image checking
  19. > ;--
  20. >         cmpc5   imagname, imagname_buf, #^A/ /, -
  21. >                 protected_image, @<dsc$a_pointer+protected_image>
  22. >         beql    update
  23.  
  24. Not directly, however there is a routine in the RTL, STR$MATCH_WILD, which
  25. will do what you want.  See HELP RTL STR$ STR$MATCH_WILD , or the Grey Wall.
  26.  
  27. > Also, as a side question, what is the extact difference between the
  28. > branching instructions   brb and brw  as in when would you use the byte
  29. > and when the word, and what advantage is the one over the other.
  30.  
  31. A BRB instruction is two bytes long -- the opcode plus the (signed) displacement
  32. to the branch destination.   This means that the dest. must be within -128 to
  33. +127 bytes of the BRB instruction.  Violate this and Macro-32 reports "branch
  34. destination out of range".
  35.  
  36. A BRW is three bytes long, allowing for a 16-bit signed displacement, so  the
  37. branch target can be within -32768 to +32767 of the BRW instruction.  BRW is
  38. marginally slower than BRB.
  39.  
  40. To  be complete:  There is also the JMP instruction which allows the use of
  41. nearly all of the addressing modes (other than register).  e.g. you can't
  42. BRW (R0) but you can JMP (R0).  JMP thus allows you to go anywhere within your
  43. address space.
  44.  
  45. btw, all conditional branch instructions use byte-sized displacments.  So
  46. most of us who code in Macro have developed a set of macros for doing
  47. conditional branches with word-sized branch displacements, e.g.:
  48.  
  49.         .MACRO  BLSSU_W DEST, ?next
  50.         BGEQU   next
  51.         BRW     dest
  52. next:
  53.         .ENDM
  54.  
  55. then
  56.  
  57.     BLSSU_W    SOMEWHERE
  58.  
  59. acts just like BLSSU SOMEWHERE would but allows about +/- 32K displacement.
  60. Since most of my code is arranged so that the branches do fit in the small
  61. displacement my usual practice is to start out with the regular conditional
  62. branch instructions and change them to _W's as needed.
  63.  
  64.     --- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
  65. uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and
  66. Chair, VMS Programming and Internals Working Group, U.S. DECUS VAX Systems SIG
  67. Internet:  jeh@cmkrnl.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
  68. Uucp:  ...{crash,eisner,uunet}!cmkrnl!jeh
  69.