[comp.sys.mac.programmer] Help writing Chooser doc using ThinkC4.0

lowersbp@ingr.com (Ben P Lowers) (06/27/90)

I am attempting to write a Chooser document (a PRER, in this case)
using Think C 4.0.  It compiles and builds with no errors, but
bombs (softly, not a hard crash or lockup) when I select it's icon
from the Chooser window.

I'm using a number of items as reference:
  The ThinkC4.0 manual describing Custom Headers;
  The MacTutor Nov-Dec '88 article on Chooser docs (but its MPW, yuck!)
  and the Summer '89 MacTech Quarterly (sample all 68K asm in MPW, yuck!)
  (and, of course SpInside Mac and the section(s) on the Device Manager)

But I can't seem to find the problem with the following code.  If any
samples of Chooser docs written in ThinkC4.0 are available, I would
be grateful if you could send me e-mail and point me towards them.

Thanks in advance!

Ben Lowers
uunet!ingr!b23b!big!ben

Code follows:  (at) is an "at" sign - my terminal is flipping out
(sorry about the long post)...
{#includes, etc...}

 
extern main(); /* declare it so we can JMP to it */
 
header()    /* first function in file */
{
	asm {
		; header for the device Chooser Package
		BRA.S	(at)devJump
	(at)deviceID
		DC.W	0
	(at)PackName
		DC.L	0x5041434B	; 'PACK'
	(at)IDnumber
		DC.W	0xF000		; -4096
	(at)Version
		DC.W	1
	(at)Flags
		DC.L	0x0000F800	; 11,12,13,14,15
		; end of header
	(at)devJump
		LEA		header,A0   ; put address of the PACK in a0
		JMP		main
	}
}
 
main()
{
}
 
pascal OSErr device(message,caller,objname,zonename,p1,p2)
...and so on...

Please help me if you can... thanks!     ...Ben