Re: Floating point calculations on 16 uC



On 28 Aug 2005 02:11:32 -0700, "db" <dbahlmann@xxxxxxxxx> wrote:

>I'm doing floating point calculations on a Fujitsu MB90F474 16bit uC.
>All float calculations are done in the main loop context. Sometimes the
>result returns a garbage value. This seems to happen only when
>interrupts are enabled. Note that there are no globals or shared data
>involved.

I have never seen that processor before, but here are some guesses.

Since all the others have posted the most likely explanations, look at
the library routine sources (assuming written in assembler) for using
the stack are without actually pushing the value into the stack, but
using offsets below the stack pointer (assuming the stack grows
downwards).

In which language is the interrupt service routine (ISR) written ? If
in some high level language, are you sure that the language subsystem
support interrupt service routines ?

If written in assembler, are you sure that every register used by the
ISR is really saved ? Pay especially attention to instruction with
side effects, such as implicitly modifying an other register, which is
not saved.

Paul

.



Relevant Pages

  • Re: Is C99 the final C? (some suggestions)
    ... You mean vague terminologies like "stack"? ... wrap whatever "spawn" mechanism you have in your language (or use some ... >> and because of Java's bignum class, it meant that exposing a widening multiply ... >> you use to determine this is just related to examining the carry flag. ...
    (comp.lang.c)
  • Re: The Promise of Forth
    ... Do you think Ada and PL/1 would be as high as they are ... They can keep a language alive at the fringes. ... still another bunch of complications when the stack holds mixed types. ... For a different data type it would have to be *completely* rewritten: ...
    (comp.lang.forth)
  • Re: FORTH levels
    ... Most working on a collaborative project do not choose the programming language they are using: it is thrust upon them by the needs of the collaboration. ... When Iverson and Hui came up with J-- in part to remove APL's special character set and make it more "user friendly" not much of a community formed around it. ... But RPN does not require a visible stack, any more than any language requires a visible stack to rebuild its semantic trees from its flat expression. ...
    (comp.lang.forth)
  • Re: Statement on Schildt submitted to wikipedia today
    ... the C language definition clearly says otherwise. ... stack functionality at a minimum ... There was because it became unfashionably "racist" to speak of German ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: [OT] PostLisp, a language experiment
    ... a preconception that there isn't a language for which longer ... > latter method in Lisp, and C and many other languages so that the code ... >> apparently no runtime checks for stack mismatches, ... > the complexity and number of stack items for each definition. ...
    (comp.lang.lisp)