i had problems with the modulus operator of the gnu libraries for gcc (i
think sdcc uses the parts of these libararies) with various processors (an
68008 among others). There was some subtle bug in the implementation of the
function, which caused the function to go into an endless loop. I sent a bug
report some 6 years ago, and i think they fixed it, but may be, this is a
reincarnation of this bug.
[mailto:sdcc-user-admin@... Auftrag von
Gesendet: Mittwoch, 6. Juni 2001 17:41
Betreff: [Sdcc-user] Problem with modulus operator
Need some help, got stuck with a function.
I'm using sdcc 2.2.1 borland version on win98.
My make.bat file looks like this:
sdcc %1.c -I d:\sdcc\include -L d:\sdcc\lib\small
I'm using a Cygnal 8051f005 microcontroller with minimal setup.
I've managed to configure the controller to generate 12 RC servo
control signal using timer interrupts routines and serial port
routine to send text to my PC for feedback purpose. Both seems
to be working fine.
My problem is that the controller seems to hang when i call the
itos function (included below). I've removed the code one by one
to see what is causing the hang. I've narrowed it down to the
modulus operator. it seems if i use the modulus operator in the
function it will hang, if i remove it it works. I've tried using
the modulus in main() and it works. I'm new with SDCC, i'm pretty
sure i've done something wrong. I've read all the documentation,
tried many things but still can't solve my problem.
Any help, suggestions appreciated.
int itos(int i,char *s)
// one line of an interger to String function
// this line should at least return the least significant number
// of the integer in the string
******* Signature File *******
Name: Howard Lim Chong Han
E-mail: limch@..., limkt231@...
Sdcc-user mailing list