Floating point variables and Math?..

If you are needing help, or have questions for the different assembly languages available.

Moderator:Moderators

Post Reply
michael
Posts:29
Joined:Thu Nov 15, 2007 12:06 am
Floating point variables and Math?..

Post by michael » Sun Dec 30, 2007 1:30 am

Is this possible in assembly?

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Tue Jan 01, 2008 12:23 am

most definatly

In the CPU, along with the ALU, there is the FPU which deals entirely with floating point numbers. all floating point instructions begin with an 'f' so that add would be 'fadd'.

However, using the FPU is harder than normal. There are 8 80bit registers that work similar to a stack. 32 and 64 bit variables can be loaded to and saved from the FPU.

I suggest reading the online book PCASM (link is in the resources section of this webside). It is an excelent resource that completely explains how to use the FPU as well as the history of it.

As for 'maths'

Any mathematical problem that I know of can be formed into an equation.
Any equation can be programmed
Any program ends up running via assembly (after interpreting or compiling and linking)

Hope this helps

Andrew

Post Reply