Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!cbatt!cbosgd!ihnp4!ihopa!riccb!djb From: djb@riccb.UUCP (Dave J. Burris ) Newsgroups: net.micro.atari16 Subject: Re: megamax bug? Message-ID: <718@riccb.UUCP> Date: Wed, 30-Jul-86 19:05:01 EDT Article-I.D.: riccb.718 Posted: Wed Jul 30 19:05:01 1986 Date-Received: Fri, 1-Aug-86 05:39:55 EDT References: <8607191804.AA14701@ucbvax.Berkeley.EDU> Organization: Rockwell Telecommunications, Downers Grove,Il. Lines: 41 > While trying to compile a program using Megamax C (ported from DRI C) with > type casting changes (coercion -- a real pain). The problem seems to be with > a pointer to a function. For example: > > long (* ptr)() > . > . code > . > return ((*ptr)(var1,var2,var3)) > > When it gets to this point, returning the result of the jump thru the pointer > to the function, it blows up. I could do this in assembly and insert it, but > that is a pain... > Any answers, comments. > > Thanks, Mike Well, this works with Megamax. This code changes the interrupt vector for the MIDI receiver. VOID jvec(); long sys_vector; main() { register long *int_ptr; int_ptr = (long *) Kbdvbase(); /* get the vector base */ sys_vector = *int_ptr; /* get old value to restore */ *int_ptr = (long) jvec; /* set new vector */ /* other code here */ *int_ptr = sys_vector; /* restore old vector */ } -- Dave Burris ..!ihnp4!ihopa!riccb!djb Rockwell Switching Systems, Downers Grove, Il.