[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About CC65 inline assembly problem.
In article <QumdneyWhdgusYHWnZ2dnUVZ_gmdnZ2d@giganews.com>,
"Michael J. Mahon" <mjmahon@aol.com> wrote:
> bluebird wrote:
> > I want to call inline assembly routine.
> >
> > void __fastcall__ displayCharA(void)
> > {
> > // Display char 'A'
> > __asm__ (" LDA #$C1 \
> > JSR $FDED");
> > }
> >
> > But it failed. So I tried like this.
> >
> > void __fastcall__ callCOUT(void)
> > {
> > __asm__ (" BIT $C082 \
> > LDA #$C1 \
> > JSR $FDED \
> > BIT $C080");
> > }
> >
> > Then it works.
> > Is there anyone to talk about this problem?
>
> From your example, it would appear that the monitor ROM (containing
> $FDED) is normally switched out, and your reference to $C082 switches
> it back in for the call, then out again before returning.
>
> A cc65 expert could tell us whether this is the usual default state
> while a program is running or not.
I'm not the expert, but I've seen and done the same thing:
<http://groups.google.com/group/comp.sys.apple2.programmer/msg/d9c4a7a4193b9833>
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>