Microsoft KB Archive/66431

{|
 * width="100%"|

How to Read Internal Floating-Point Function Names

 * }

Q66431

6.00 6.00a 6.00ax 7.00 | 6.00 6.00a | 1.00 1.50 1.51 1.52 MS-DOS | OS/2 | WINDOWS kbprg -- The information in this article applies to: - The C Run-time (CRT) included with: - Microsoft C for MS-DOS, versions 6.0, 6.0a, and 6.0ax - Microsoft C for OS/2, versions 6.0 and 6.0a - Microsoft C/C++ for MS-DOS, version 7.0 - Microsoft Visual C++ for Windows, version 1.0, 1.5, 1.51, and 1.52 -- SUMMARY ======= Applications compiled for alternate math using the Microsoft C Compiler versions 6.0, 6.0a, 6.0ax, C/C++ version 7.0, and Visual C++ 1.00 are embedded with function calls in order to perform the floating-point calculations. This can be observed by viewing the .COD listing file generated when compiling with the /Fc option. MORE INFORMATION ================ The functions you see in the code perform a task similar to the 80x87 instructions that would be needed for the same situation. Therefore, it is fairly easy to determine what the name of each function means and what the function does. Each name is composed of fields similar to the following __a(far/near call)(segment)(operation)(data type)(reverse/pop) where (far/near call) is either &quot;F&quot; or &quot;N&quot;. This specifies that the altmath helper is called either far or near. (segment) is &quot;f&quot;, &quot;s&quot;, or &quot;e&quot;. If the altmath helper needs an argument, the compiler will set BX to point to the argument. If the altmath routine has an &quot;f&quot; in its segment field, then DS:BX points to the argument. &quot;s&quot; means that SS:BX points to the argument and &quot;e&quot; means ES:BX. If no argument is needed, then &quot;f&quot; is used. (For example, __aNfadd doesn't need an argument but instead uses st(0) and st(1) off of the altmath stack, just like the &quot;fadd&quot; 80x87 instruction.) (operation) is similar to the 80x87 instructions. &quot;add&quot;, &quot;sub&quot;, &quot;mul&quot;, &quot;div&quot;, &quot;ld&quot; (load to altmath stack), and &quot;st&quot; (store from stack). (data type) is one of the following: &quot;s&quot; for single precision or float. &quot;d&quot; for double precision or double. &quot;w&quot; for word or 16 bit integer. &quot;l&quot; for long or 32 bit integer. &quot;q&quot; for qword or 64 bit integer. '' for no data type needed. This field is used only when bx points to an argument. (reverse/pop) is &quot;p&quot;, &quot;r&quot; or ''. In most cases, it is not used. If the operation was a &quot;st&quot; (store), then a &quot;p&quot; at the end means to pop the stack after the store. If the operation was div or sub, then an &quot;r&quot; means to do the reverse version of the operation. So, __aNfadds is a near called routine that will add the top of the altmath stack st(0) with the float (single precision) in DS:BX. This is similar to &quot;fadd dword ptr ds:[bx]&quot; in 80x87 code. Additional reference words: kbinf 6.00 6.00a 6.00ax 7.00 1.00 1.50 1.51 1.52 KBCategory: kbprg KBSubcategory: CRTIss

Keywords : kb16bitonly

Issue type :

Technology : kbVCsearch kbAudDeveloper kbCRT