james@utastro.UUCP (James McCartney) (08/11/88)
I'm trying to translate some driver routines from MDS 68000 Asm to Lightspeed C and have run into a few things that LSC won't let me do. First, I want to access global variables off a register other than A5 by doing something like : int MyVar1, MyVar2; int IntHand() { asm { MOVE.L CurrentA5,A3 MOVE MyVar1(A3),MyVar2(A3) } } LSC says 'invalid addressing mode' because (I guess) it expects globals to be referenced off A5. I know I can get around this one by saving and restoring A5 but I'd rather not have to waste time. Second, when I try to load function addresses into an interrupt vector LSC puts an offset(A5) address, which is an index into the jump table I presume. What I need is an PC relative address to be loaded like: LEA IntHand(PC),A0 If I do : LEA IntHand,A0 I will get the offset(A5) address in LSC where MDS 68000 would give me the offset(PC) version. I haven't been able to think of a way to get the address in the int. vector. Are there ways in LSC to do what I want? --- James McCartney