home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dmc.com!munroe
- From: munroe@dmc.com (Dick Munroe)
- Newsgroups: vmsnet.internals
- Subject: Re: Help on image checking macro using wildcards
- Message-ID: <1992Aug19.065021.4449@dmc.com>
- Date: 19 Aug 92 06:50:21 EDT
- References: <01GNJ1BM4UZQ8WXWVA@UCBEH.SAN.UC.EDU>,<1992Aug16.092754.629@cmkrnl.com> <Bt5JKF.HJn@news.cso.uiuc.edu>
- Organization: Doyle, Munroe Consultants, Inc., Hudson, MA
- Lines: 32
-
- In article <Bt5JKF.HJn@news.cso.uiuc.edu>, mako@uihepa.hep.uiuc.edu ("Makoto Shimojima, Univ of Tsukuba/CDF") writes:
- >> 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
- >
- > Has someone coded a macro that would automatically choose the optimal
- > instruction depending on the range of the displacement? I mean something
- > like BLSSU_X that would turn out to be BLSSU/BLSSU_W/BLSSU_L if the
- > displacement is 1 byte/word/longword? I once tried it using .NTYPE (I
- > think that was what I used) but that did not work correctly when the
- > destination was undefined at the time the macro was expanded...
- >
-
- The problem is that the actual branch distance isn't known until pass 2 (if the
- references are forward). In this case, you need to reserve the maximum amount
- of space for any branch code (using NOPs or you can just jam the PC counter for
- the psect). Then for each branch that works, you generate the branch code,
- make sure that all of your cases know how much space needed to be reserved and
- adjust themselves appropriately and generate NOPs or a branch to the end of the
- allocated space. In short, it's a mess, doable, but a mess.
-
- If you DON'T do this, you wind up with phase errors if the actual branch
- instruction(s) wind up being different between passes 1 and 2 of the assembler.
-
- Dick Munroe
- --
- Dick Munroe Internet: munroe@dmc.com
- Doyle Munroe Consultants, Inc. UUCP: ...uunet!thehulk!munroe
- 267 Cox St. Office: (508) 568-1618
- Hudson, Ma. FAX: (508) 562-1133
-
- GET CONNECTED!!! Send mail to info@dmc.com to find out about DMConnection.
-