Xref: utzoo comp.sys.mac.hypercard:340 comp.sys.mac:12396 Path: utzoo!utgpu!water!watmath!clyde!rutgers!uwvax!umn-d-ub!umn-cs!mmm!ems!viper!john From: john@viper.Lynx.MN.Org (John Stanley) Newsgroups: comp.sys.mac.hypercard,comp.sys.mac Subject: Re: HyperCard XFCNs in MPW C Message-ID: <609@viper.Lynx.MN.Org> Date: 11 Feb 88 21:41:55 GMT References: <226STORKEL@RICE> <3105@watcgl.waterloo.edu> <7360@apple.UUCP> Reply-To: john@viper.UUCP (John Stanley) Organization: DynaSoft Systems Lines: 41 Posted: Thu Feb 11 15:41:55 1988 In article <7360@apple.UUCP> tomas@apple.UUCP (Tom Taylor) writes: > >Here is a way, though not elegant, to put string literals in the >code of a standalone resource. ....... > >Example: > >In ASM: > >stringFoo PROC EXPORT > DC.B 'This is a string' > ENDPROC > END > >In C: > >extern char *stringFoo; I don't know much about using C on the Mac, but I do know a good deal about mixing C and assembly language on a 68000 based machine and this "looks very wrong".... If you define a data constant in assembly using DC.B you can then access the string and/or data structure by defining it as external in your C code, but you need to define it AS-A-STRING, not as a pointer. If it were a pointer that would be different, but your example explicitly defines the data to be at stringFoo, not a pointer to the string... Thus the C define to access the assembly-string would be: extern char stringFoo[]; > >Tom Taylor >Development Systems Group > --- John Stanley (john@viper.UUCP) Software Consultant - DynaSoft Systems UUCP: ...{amdahl,ihnp4,rutgers}!meccts!viper!john