Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.lang.c Subject: "Portable" asm Message-ID: <4402@june.cs.washington.edu> Date: 8 Mar 88 22:50:01 GMT Reply-To: pardo@uw-june.UUCP (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 38 References: Assuming that you want asm... To increase the portability of the "asm" directive, there should be some way of telling the compiler which globals, which special registers, etc. you want to use. The syntax is bogus, but here's the idea: + state (prototype) all the resources you need + hide access to everything else #include struct foo { ... } glob1, glob2; anotherfunc() { ... } myfunc() { int locvar; /* code */ start_asm( glob1, glob2, anotherfunc, asm_tmps(3), locvar ) { #ifdef ASM_VAX /* high-level assembly code goes here */ #elseif ASM_MC68000 /* high-level assembly code goes here */ #else ASM_FAILED #endif } /* code */ } ;-D on (The program is dead, but the code lives on) Pardo