[Info-vax] Text processing examples with Fortran requested
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Mon Nov 16 08:10:51 EST 2009
In article <hdqavr$n8g$1 at pcls4.std.com>, moroney at world.std.spaamtrap.com (Michael Moroney) writes:
>Speaking of text manipulation, I'll ask this, though I know it's a real
>shot in the dark.
>
>Does anyone know of any tools to manipulate VAX Macro-32 code? By
>"manipulate" I mean to find instructions with specific addressing modes
>or do things like convert all word instructions whose destination is a
>register to longword equivalent and find all MOVAx instructions whose base
>is R7, all without being fooled by commented out lines, of course.
It might be easier to search the VAX Macro machine listing. Define the
opcodes of interest and masks for the addressing modes you're interested
in.
>I know I'll have to write individual tools, and will have to learn
>one of those text manipulation "languages", but I figure I'd ask anyway.
>
>I have to deal with thousands of lines of the most gawdawful macro-32
>code ever created.
Doubtful. I'll bet I've seen worse. ;)
If you really need to change a MOVW src,dst to MOVL src,dst, writing a
macro to do so might be your better bet.
.MACRO .REDEFINE_MOVW
.MACRO MOVW,src,dst
.MDELETE MOVW
.NTYPE ...ADDR_MODE...,dst
.IF EQ <...ADDR_MODE... at -4&^XF>-5 ; register mode?
.IF_TRUE
MOVL src,dst
.IF_FALSE
MOVW src,dst
.ENDC
.REDEFINE_MOVW
.ENDM MOVW
.ENDM .REDEFINE_MOVW
.REDEFINE_MOVW
:
:
I believe that that's all right. If not, blame it on the fact that I'm not
well caffeinated yet at this hour of the day.
I've done the above quite often for branches. For example, for a BLBx where
the target address is well beyond the byte displacement. The macro figures
out if there's a need to use a just BLBx or a BLBx and a helper BRW or JMP.
It unclutters the code quite a bit. I often put a .PRINT in the conditional
part of the macro to show this in the .LISting.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
http://www.quirkfactory.com/popart/asskey/eqn2.png
"Well my son, life is like a beanstalk, isn't it?"
More information about the Info-vax
mailing list