home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!NewsWatcher!user
- From: REEKES@applelink.apple.com (Jim Reekes)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: MacsBug symbols from assembler code?
- Message-ID: <REEKES-240892122200@90.10.20.67>
- Date: 24 Aug 92 19:22:58 GMT
- References: <1992Aug20.155733.6869@daimi.aau.dk> <1992Aug21.030941.6506@bilby.cs.uwa.edu.au>
- Sender: usenet@Apple.COM
- Followup-To: comp.sys.mac.programmer
- Organization: Apple Computer, Inc.
- Lines: 87
-
- In article <1992Aug21.030941.6506@bilby.cs.uwa.edu.au>, quinn@cs.uwa.edu.au
- (Quinn) wrote:
- >
- > In article <1992Aug20.155733.6869@daimi.aau.dk> Peter Andersen,
- > datpete@daimi.aau.dk writes:
- > >Am I missing something?
- >
- > Hmm. I had great fun getting MacsBug symbols working consistently
- > in my latest Asm project. Try using the following macro (with
- > apologies to those people whose systems don't expand tabs
- > properly)...
- >
- > ----------------------------------------------
- > macro
- > MacsBug &Name,&rts:int
- > lclc &oldstr
- > gbla &debug
- >
- > if &debug then
- >
- > if &rts then
- > rts ; force rts in specific cases
- > endif
- >
- > dc.b &len(&name)+$80 ; length of string + $80 marks symbol
- > &oldstr setc &setting('string')
- > string AsIs
- > dc.b '&upcase(&Name)' ; define the string AsIs
- > string &oldstr
- > align ; pad to word boundary
- > dc.w 0 ; no literals
- >
- > endif
- >
- > endm
- > ----------------------------------------------
-
- Here's the macro I currently use.
-
-
-
- macro
- symbol &routineName=&SysMod,&size=0
- lclc &name, &oldString
-
- IF &TYPE('DEBUG') <> 'UNDEFINED' THEN
- rts
- if &routineName[1:1] = '''' then
- &name: setc &eval(&routineName)
- else
- &name: setc &routineName
- endif
-
- &oldString: setc &setting('string')
- string asis
- if &len(&name) < 32 then
- dc.b &len(&name)+$80,'&name'
- else
- dc.b $80,&len(&name),'&name'
- endif
- string &oldString
- align
- dc.w &size
- endif
-
- endm
-
-
- Just becareful where you add this.
-
- It needs the RTS because sometimes you write Asm routines without a
- Link/Unlink. The usage should be like this.
-
- SomeRoutine proc
- ...
- ...
- ...
- symbol "SomeRoutine"
- endp
-
-
- -----------------------------------------------------------------------
- Jim Reekes, Polterzeitgeist | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | RAll opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc.S
-