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

Paul D. DeRocco pderocco@ix.netcom.com
Sat Mar 5 01:18:00 GMT 2011

> From: Quanren Xiong
> 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?

ARM does division in software, so it's up to the library routine. When I
worked with ARM/eCos a few years ago, division by zero didn't invoke any
exception; I doubt that has changed.

> 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?

Alignment faults can be enabled in register CP15. You should download the
data sheet on the processor from Atmel, and the one on the core itself from
ARM, so you can figure this stuff out.


Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com 

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