Amiga-C (55/157)

From:Gunther Nikl
Date:13 Sep 2001 at 15:12:10
Subject:[amiga-c] Re: VB int problem (was Re: Help needed with random crashing problem)

Hello Paul,

> > [placement of local variables]
>
> Ah yes, makes sense. I guess the only way to tell is to look at the
> assembler code though.

Right.

> > But your interrupt function is a critical part. You should always try
> > to be as fast as possible. If you can avoid absolute addressing you
> > should do. It doesn't matter what the rest of your program does.
>
> I'm not sure Storm C allows you to compile the interrupt code
> differently (i.e. with a small data model) than the rest of the code.

Well, you misunderstood. If you access global data within a function
the compiler must access that data: either through A4 (small data) or
directly (large data). However, if you pass all your interrupt data
as an argument to your function then you will access the data relative
to that argument. The nice thing about this is that your function gets
reentrant ;-) The OS passes is_data of your interrupt structure in A1
to your function. Use it ;-)

> Yeah, odd how the compiler doesn't seem to care about them even though
> it should know that the code is part of an interrupt (__interrupt used).
> I guess technically it's a bug, although as you say the RKMs make no
> mention of the FPU so it's a slightly gray area.

There is no bug in the compiler. I guess you have a wrong notion about
the "__interrupt" qualifier. That qualifier does only tell your compiler
that it must set the flags. It does this by inserting a "tst.l d0"
directly before the "rts". The compiler treats interrupt functions the
same way as any other function there scratch registers are scratch
registers. Its fortunate that AmigaOS interrupt functions declare the
same register to be scratch registers as the ABI for normal functions.

> > I wasn't talking about CIA timers but about timer.device.
>
> But even then, does it sync accuratly enough vblank to make analogue joy
> reading work? I'd have to try it.

I don't know. I never had to touch amiga customchip registers when I used
a PA_SOFTINT message port.

Gunther

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Do you need to encrypt all your online transactions? Secure corporate intranets? Authenticate your Web sites? Whatever
security your site needs, you'll find the perfect solution here!
http://us.click.yahoo.com/wOMkGD/Q56CAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/