Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!csus.edu!ucdavis!iris!mock From: mock@iris.ucdavis.edu (Kenrick J. Mock) Newsgroups: comp.sys.apple2 Subject: Re: Orca/C/M...Ack! Message-ID: <8393@ucdavis.ucdavis.edu> Date: 17 Feb 91 18:10:52 GMT References: <28630.27bd478e@kuhub.cc.ukans.edu> Sender: usenet@ucdavis.ucdavis.edu Reply-To: mock@iris.ucdavis.edu (Kenrick J. Mock) Organization: U.C. Davis - Dept of Electrical Engineering and Computer Science Lines: 59 Here is an easy way to mix Orca C and Orca M together. Here is the general structure of your Orca/M file: ************************************************************************ keep myprog MYPROG start * init stuff. Set data/prog bank phk plb * maybe save processor status as well and disable interrupts if necessary php sei * Your program goes here lda somevar ... WDM ; Your code goes here, do something with somevar ... * Quit code. Load a #0 as the returning value plp lda #0 rtl SOMEVAR entry ; Declare SOMEVAR as external entry point dc H'00 00' end ************************************************************************ From the shell, ASML MYPROG. Here is what the C program can look like: /********************************************************************/ #pragma keep "CPROG" extern void MYPROG(void); /* Declare external parameters */ extern void SOMEVAR(void); main() { word *asmparm; asmparm=(word *) SOMEVAR; *asmparm=0x0101; /* your parameter */ MYPROG(); /* Call the assembly procedure */ } /********************************************************************/ Compile CPROG.CC. Then do a "link cprog myprog keep=cprog" and the resulting EXE file will execute your Orca/M code. This method is a little simpler than passing in parameters through the stack, although it is not as clean. Opponents of global variables are certain not to like it... In any case, I hope it helps. Ken P.S. Play Columns! Oh, also, if all you want to do is load and display a $C1 picture, you can load it directly to $E12000 and the picture will load right to the SHR screen. ------------------------------------------------------------------------------ "When you make your mark in the world, watch out for guys with erasers." - Wall Street Journal. GEnie : K.MOCK Net : mock@iris.ucdavis.edu, mock@alderon.lanl.gov