Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!ucbvax!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Inline assembly code in Think C 4.0 Keywords: assembly, Think C Message-ID: <3645@husc6.harvard.edu> Date: 27 Jul 90 00:52:36 GMT References: <1990Jul26.204548.8163@cec1.wustl.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Distribution: usa Organization: Symantec Language Products Group Lines: 40 In article <1990Jul26.204548.8163@cec1.wustl.edu> jyp@wucs1.wustl.edu (Jerome Yvon Plun) writes: >Think C manual states that the Toolbox functions not in ROM can not be used >in inline assembly code. That's an error in the doc; in fact, you can call any external routine from within inline assembler code, including Toolbox routines which are marked [Not in ROM]. To do so, just place an external reference in the function in which you call the desired routine, push the arguments, and call the function: void f( ) { extern pascal Boolean LClick(); asm { clr.b -(a7) ; space for result move.l p, -(a7) ; a point move.w m, -(a7) ; a word move.l l, -(a7) ; a ListHandle jsr LClick ; call it move.b (a7)+, d7 ; pop the result } } R. ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "I have been known, on occasion, to howl at the moon." ~~~~~~~~~~~~~~~