[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] initial patch for interrupt flag/enable bits
From: |
John Regehr |
Subject: |
Re: [Simulavr-devel] initial patch for interrupt flag/enable bits |
Date: |
Thu, 20 Nov 2003 15:44:45 -0700 (MST) |
I'll make both of these changes.
I'll just submit a big patch with interrupt bits for all mega AVRs. I
don't have manuals for the non-megas handy so I'll let someone else do
those (or I'll do it at a later date).
Thanks,
John
On Thu, 20 Nov 2003, Theodore A. Roth wrote:
>
>
> On Thu, 20 Nov 2003, John Regehr wrote:
>
> > I'm attaching a patch that adds interrupt flag and enable bits to the
> > ATmega16 specification. Let me know if this looks good and I'll do more.
> >
> > The patched simulator should run as before; the extra information won't be
> > useful until other code is hacked.
>
> Wouldn't it be more efficient to pass a bit mask instead of the bit
> position? Then the check becomes (psuedo code):
>
> if ((sreg & SREG_I) && (read_io_reg(addr) & bitMask))
> ...
>
> instead of this:
>
> if ((sreg & SREG_I) && (read_io_reg(addr) & (1 << bit)))
> ...
>
> Are you planning on needing the bit position else where?
>
> One nitpick. I'm trying to keep new to code to less than 80 chars. I'd
> rather see this:
>
> ! .INT0 = { "IRQ_INT0", 0x02, 0x00, { 0x5b, 6 }, {
> 0x5a, 6 } },
>
> written as this:
>
> ! .INT0 = { "IRQ_INT0",
> ! 0x02, 0x00, { 0x5b, 6 }, { 0x5a, 6 } },
>
> If don't don't feel like reformatting, I'll do it before committing, but
> I'd rather not. ;-)
>
> Other than those, I think I like where this is headed.
>
> Thanks.
>
> Ted Roth
>