CW9: Function address for multisegment application.

2004-05-12 Thread Konstantin Klyatskin
This is a cut from my CW9 code: asm void table() { dc.w 0,1,2,3,4,5// etc. } void test1() { short * data; data = (short *)table; // now should be data[0] should = 0; data[1] should =1; etc. } OR asm short test2(short y, short cb, short cr) { fralloc+ movem.l d

Re: CW9: Function address for multisegment application.

2004-05-12 Thread Ben Combee
At 12:39 PM 5/12/2004, you wrote: Everything (test1 and test2) works fine providing the code lays in the first code segment (code0). It fails for any other segment. Is there any way to use PC relative offset like lea.l table(PC),a0 (CW does not accept this syntax) or any other way to find corre

Re: CW9: Function address for multisegment application.

2004-05-12 Thread Konstantin Klyatskin
Ben, I talked not about offset between codes in different segments. I talked about possibility to make the code (staying in any single segment) to use offsets to PC pointer rather than table jumps. Then independently upon amount of segments I could use the adresses to navigate inside any single se

Re: CW9: Function address for multisegment application.

2004-05-13 Thread Konstantin Klyatskin
Ben, probably you'll be interested in solution I've used: Instead of trying to get address of table in any segment I use a call to fuction which returns me a pointer. That's how it works: == in any new segment asm void GetAddressA0() { move.l (a7)+,a0 rts } asm char * Table() {