Xref: utzoo comp.lang.c:12454 comp.std.c:364 Path: utzoo!attcan!uunet!husc6!bloom-beacon!apple!voder!pyramid!ctnews!starfish!cdold From: cdold@starfish.Convergent.COM (Clarence Dold) Newsgroups: comp.lang.c,comp.std.c Subject: Re: Calling functions by address Message-ID: <707@starfish.Convergent.COM> Date: 9 Sep 88 17:45:35 GMT References: <758@goofy.meest.UUCP Organization: Convergent Technologies, San Jose, CA Lines: 33 From article <679@mssx.UUCP>, by src@mssx.UUCP (Pleschutznig Andreas): > > So we thought of doing that job by declaring the addresses of the emulation > routines and jumping to the routines by address like this > > (*addressarray[code]); > > I know, I know that *does not* work, but maybe there is someone knowing to > get around. I don't know about that not working, but this one does work. For QuickC, running on a PC, jumps to a ROM based routine (actually the reset jump for an 8088 CPU chip). I use this same method to 'wrap' the ROM based disk format that is contained in BIOS ROM on the controller card with a friendlier menu. main () { void (far *bye) (); int far *pt; pt = ((int far *) (0x0000472L); *pt = 0x1234; /* for warm boot */ /* *pt = 0x0000; */ /* for cold boot */ bye = (void far *) 0x0ffff0000L; (*bye) (); } -- Clarence A Dold - cdold@starfish.Convergent.COM (408) 435-5274 ...pyramid!ctnews!mitisft!professo!dold P.O.Box 6685, San Jose, CA 95150-6685