It is a simple concept wherein I have to get rid of the fractional part of the floating point number:
1 2
double d = 12.34
int i = d;
Variable i would just contain 12. How would the same concept be implemented in assembly language. The procedure is complicated by the fact that you can't work with the floating point unit (the f registers) and the regular integer unit(the t registers and what not) at the same time. Any specific command that I am unaware of? cvt.s.w and trunc.w.s do not seem to work.
Wouldn't it be super simple for an assembly-savvy person like yourself to compile a C program with the above sample, then asking your IDE to show you the generated assembly? Visual Studio from Micrsoft can do that.
I don't know assembly so I cannot give you a straight answer.
What kind of assembly are you dealing with here, I'm most familiar with x86. It might be easiest if you find a compiler for your processor and use that language instead.
If there's no FPU to do the calculations than why even bother using floating point precision?
I had the same idea, using Visual Studio to generate the assembly. I tried using he "FAcs" option in project properties to show source and assembly code as output. Nothing happens, however. No assembly output is shown. You wouldn't happen to know how to generate assembly (and actually see it). I am using MS Visual Studio 2005.
You can use a debugger such as gdb, olly or ida. I can tell you it simply uses fld and fst to load a float or double and to store an int. It depends what syntax you are using to determine the types you are loading and storing. You can do fld0 which will place a zero onto the TOS for the fpu as a test.