home *** CD-ROM | disk | FTP | other *** search
- 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
- Newsgroups: vmsnet.internals
- Subject: Re: Help on image checking macro using wildcards
- Message-ID: <1992Aug16.092754.629@cmkrnl.com>
- From: jeh@cmkrnl.com
- Date: 16 Aug 92 09:27:54 PDT
- References: <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>
- Organization: Kernel Mode Consulting, San Diego, CA
- Lines: 58
-
- In article <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>,
- CORDELKJ@UCBEH.SAN.UC.EDU writes:
- > in the following routine can I use wildcards?
- >
- > ;++
- > ; Check for protected image
- > ;
- > ; Delete following 3 lines to remove protected image checking
- > ;--
- > cmpc5 imagname, imagname_buf, #^A/ /, -
- > protected_image, @<dsc$a_pointer+protected_image>
- > beql update
-
- Not directly, however there is a routine in the RTL, STR$MATCH_WILD, which
- will do what you want. See HELP RTL STR$ STR$MATCH_WILD , or the Grey Wall.
-
- > Also, as a side question, what is the extact difference between the
- > branching instructions brb and brw as in when would you use the byte
- > and when the word, and what advantage is the one over the other.
-
- A BRB instruction is two bytes long -- the opcode plus the (signed) displacement
- to the branch destination. This means that the dest. must be within -128 to
- +127 bytes of the BRB instruction. Violate this and Macro-32 reports "branch
- destination out of range".
-
- A BRW is three bytes long, allowing for a 16-bit signed displacement, so the
- branch target can be within -32768 to +32767 of the BRW instruction. BRW is
- marginally slower than BRB.
-
- To be complete: There is also the JMP instruction which allows the use of
- nearly all of the addressing modes (other than register). e.g. you can't
- BRW (R0) but you can JMP (R0). JMP thus allows you to go anywhere within your
- address space.
-
- btw, all conditional branch instructions use byte-sized displacments. So
- most of us who code in Macro have developed a set of macros for doing
- conditional branches with word-sized branch displacements, e.g.:
-
- .MACRO BLSSU_W DEST, ?next
- BGEQU next
- BRW dest
- next:
- .ENDM
-
- then
-
- BLSSU_W SOMEWHERE
-
- acts just like BLSSU SOMEWHERE would but allows about +/- 32K displacement.
- Since most of my code is arranged so that the branches do fit in the small
- displacement my usual practice is to start out with the regular conditional
- branch instructions and change them to _W's as needed.
-
- --- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
- uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and
- Chair, VMS Programming and Internals Working Group, U.S. DECUS VAX Systems SIG
- Internet: jeh@cmkrnl.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
- Uucp: ...{crash,eisner,uunet}!cmkrnl!jeh
-