EmbeddedRelated.com
Forums

Floating-Point Assembler Code

Started by ga5941 January 22, 2009
I'm a hobbyist writting assembler code for a MC9S12A256 using AN974,
the MC68HC11 Floating-Point Package written by Gordon Doughman. I'm
getting some strange results and wonder if anyone else is experiencing
problems using this package. The application is controlling a dob
telescope with stepper motors.
I think there are some bugs in that code. I'll attach a floating point
package that worked for me. It was provided to me from someone else on the
list here.

Dave
On Thu, Jan 22, 2009 at 2:42 PM, ga5941 wrote:

> I'm a hobbyist writting assembler code for a MC9S12A256 using AN974,
> the MC68HC11 Floating-Point Package written by Gordon Doughman. I'm
> getting some strange results and wonder if anyone else is experiencing
> problems using this package. The application is controlling a dob
> telescope with stepper motors.
>
>
>

The below is from memory.

I have never used the HC11 Floating-Point Package. But, there is one subtle difference between the HC11 and HC12 that could cause some strange things to happen on calling any routines where parameters are passed via the stack. The HC11 stack pointer points to the next available position on the stack; the HC12 stack pointer points to the last used position on the stack.

HTH

Emmett Redd Ph.D. mailto:E...@missouristate.edu
Professor (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University Fax (417)836-6226
901 SOUTH NATIONAL Dept (417)836-5131
SPRINGFIELD, MO 65897 USA

Physicists always practice energy conservation.
________________________________

From: 6... on behalf of ga5941
Sent: Thu 1/22/2009 3:42 PM
To: 6...
Subject: [68HC12] Floating-Point Assembler Code

I'm a hobbyist writting assembler code for a MC9S12A256 using AN974,
the MC68HC11 Floating-Point Package written by Gordon Doughman. I'm
getting some strange results and wonder if anyone else is experiencing
problems using this package. The application is controlling a dob
telescope with stepper motors.
Redd, Emmett R wrote:

> I have never used the HC11 Floating-Point Package. But, there is one
> subtle difference between the HC11 and HC12 that could cause some strange
> things to happen on calling any routines where parameters are passed via
> the stack. The HC11 stack pointer points to the next available position
> on the stack; the HC12 stack pointer points to the last used position on
> the stack.
>

Yes, but to access stack space on HC11, one had to transfer SP to X or Y
index register. On HC11 TSX and TSY transfer SP+1 to X and Y, and on HC12
TSX and TSY transfer SP+0 to X and Y. So I don't know how hardware
independent HC11 code could fail on HC12.

HC11FP +-*/ operations have some flaws and math functions have not very good
accuracy.

Regards
Edward