Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucsd!nosc!crash!jcs From: jcs@crash.cts.com (John Schultz) Newsgroups: comp.sys.amiga.tech Subject: Re: ModulaII and Assembly Pt.2 Message-ID: <4736@crash.cts.com> Date: 30 Sep 90 19:54:53 GMT References: <4727@crash.cts.com> Organization: Crash TimeSharing, El Cajon, CA Lines: 25 In article <4727@crash.cts.com> lkoop@pnet01.cts.com (Lamonte Koop) writes: > > I want to thank everyone who sent and posted replies (so far) to my >question about interfacing an assembly routine into a Modula-2 program to >allow me to manipulate an 020 or 030 CACR register. Unfortunately, to this >time, no joy. Basically, the easiest way to do this is to write the routine >in assembly, assemble it, grab the actual machine code listing, and insert it >into an M2 procedure using an INLINE statement, which basically just inserts >the code sequence into the instruction program as is. Unfortunately, the code >for grabbing the CACR blows up on me. I've even used Dave Haynie's EXACT code >sequence from SetCPU, assembled that and tried the machine code in my INLINE >statement. Still no luck. (I'm usually ending up with something like GURU >$0000000E or the like) This code SHOULD work! The assembled version works >great...the M2 INLINE version, which is just the machine code itself inserted >in the program, dies. Any clues from anyone else??? I'm lost. (Semms to be a >fairly normal state of being for me lately...) > It will work: the stack and registers must be preserved upon exit. That's probably why it's blowing up with address errors. Also, disassemble your M2 code to make sure the INLINE's are corrects. John