[comp.sys.mac] MDS -> MPW asm code conversion question

bob@accuvax.nwu.edu (Bob Hablutzel) (11/28/88)

I also converted from MDS to MPW recently, and had a lot of the same problems.
The TAB problem I can't comment on - I haven't tried to work around this. I
think the problem is that labels _must_ start in the first column, and EQU
symbols are considered labels.

To get around the parameter passing, I switched to the structured macros
supplied with MPW. I tend to dislike structured macros in general, but the
Procedure (Function), Begin, and Var macros are wonderful. Fantastic. Great.
I cannot say enough about these macros. (Well, granted that sometimes typos
in these macros can introduce subtle and wonderful bugs - caveat emptor!).
These routine make writing Pascal callable routines a trivial task. I have
switched to these routines for _all_ my routines, and have noticed that my
code has become much more readable. Plus, my health is better, and I think 
that it's been an extremely mild winter so far...

OK, maybe these macros don't rank with sliced bread. But try to take them
away from me, and I'm armed and dangerous.

Bob Hablutzel		BOB@NUACC.ACNS.NWU.EDU

rick@Jessica.stanford.edu (Rick Wong) (11/30/88)

In article <10330088@accuvax.nwu.edu> bob@accuvax.nwu.edu (Bob Hablutzel) writes:
>I also converted from MDS to MPW recently, and had a lot of the same problems.
>The TAB problem I can't comment on - I haven't tried to work around this. I
>think the problem is that labels _must_ start in the first column, and EQU
>symbols are considered labels.
>

After running your MDS source through MDSCvt, you can use MPW's "replace"
command to take out the leading whitespace in EQU declarations.  The fol-
lowing commands will do the trick:

target mysrc.a		; set up find/replace target
set space "<d>t "	; the blank is important
find <8>		; make sure selection is at beginning of file
replace -c <5> /<8>[{space}]+(<x>[{space}]equ[{space}]<x>)<r>1/ "<r>1"

Notation:  characters in angle-brackets are option-characters (e.g.,
<5> is option-5 (the infinity character)).

The regular expression in the above replace command looks for lines that
start with whitespace and that contain an "equ" token.  The stuff follow-
ing the leading whitespace is tagged (<r>1), and the entire line is
replaced with the tagged portion, effectively deleting the leading white-
space.

Nifty, eh?

Rick Wong
Courseware Authoring Tools Project, Stanford University
rick@jessica.stanford.edu