Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Division function

2004-11-01 by dean_j_greaves

Hi,
  I having a problem with some code i'm developing on the LPC2214 
chip using GNU tools.  
  I have a simple function that performs a division.

  unsigned int a=0, b=1000, c=10;

  a=b/c;

  When i compile up the code and download to the target, the code 
breaks when i step over this division routine.  When i step in to the 
assembly code for the division, it has compiled in  __divsi3 from the 
libgcc library.
  The problem appears to be that just before the return from the 
division function, it attempts to restore registers from the stack 
that it never actually push onto the stack.
  Has anyone ever come across this before.  Any help would be 
gratefully received.

  Dean

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.