[ECOS] Re: Dividing by zero does NOT generate exception

Quanren Xiong xiongqr@gmail.com
Sat Mar 5 01:01:00 GMT 2011


Hi Grant,

The hardware is KwikByte KB9200 board from eCosCentric, which is based
on the ARM9 AT91RM9200 processor. But more RAM and ROM are added.

I am new to the ARM architecture.  Can someone confirm the processor
does NOT generate exception on dividing by 0?

Another odd thing I found is that It does NOT generate bad memory
alignment exception either.
For example, the following code will run just fine:

unsigned int addr=0x00040041;
*(int *)addr=0xFEFEFEFE;

Should it generate a bad alignment exception?

To me, it seems that either all the exceptions are blocked by HAL, or
the hardware does not generate exception at all.  How can I find out
which case is true?

I looked the file vectors.S. Is there any way I can find out any of
the exception handler got invoked by printing out in the console?  Of
course, I can NOT call diag_printf() in vector.S, I mean by doing
something similar but in assembly.  Because I can not do hardware
debuging like using JTAG.

Thanks



On Fri, Mar 4, 2011 at 6:20 PM, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> On 2011-03-04, Grant Edwards <grant.b.edwards@gmail.com> wrote:
>> On 2011-03-04, Quanren Xiong <xiongqr@gmail.com> wrote:
>>
>>> I am using ECOS 2.0.33.  To my suprise, the following code does NOT
>>> generate an exception.
>>>
>>> "int b=1; int c=b/0;" The value in variable c will be 0.
>
>> You're expecting a run-time exception from something that doesn't
>> actually execute at runtime.
>
> I think I got that one wrong.  For some reason I convinced myself you
> were talking about static variables, but the second initialize isn't
> lebal for a static initializer.
>
> Perhaps your processor doesn't generate an exception for integer
> divide by zero?
>
> --
> Grant Edwards               grant.b.edwards        Yow! The PINK SOCKS were
>                                  at               ORIGINALLY from 1952!!
>                              gmail.com            But they went to MARS
>                                                   around 1953!!
>
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list