News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Posible Bug in MASM32 October Release

Started by MusicalMike, November 11, 2005, 11:36:48 PM

Previous topic - Next topic

MusicalMike

Posible bug in october eddition image

the following code


.486                                     
.model flat, stdcall                     
option casemap :none                     

include windows.inc
include kernel32.inc
include user32.inc
include msvcrt.inc
   
includelib kernel32.lib
includelib user32.lib
includelib msvcrt.lib

.data
int1 dd 22
int2 dd 6
output db "The result is %f ", 00h

.code
Start:

finit
fld 43.65
fidiv int1
fld 76.34
fld 3.1
fmul st(0), st(1)
fadd st(0), st(2)
fld 12.43
fimul int2
fld 140.2
fld 94.21
fdivr
fsubr st(0), st(1)
fdivr st(0), st(2)
sub esp, 8
fstp offset [esp]
push offset output
call crt_printf
add esp, 12
push 5000
call Sleep
leave
   
End Start



produced this output durring assemble


Assembling: C:\WinAsm\Projects\Scratch Pad2\floatingpoint\tut1.asm
C:\WinAsm\Projects\Scratch Pad2\floatingpoint\tut1.asm(35) : fatal error A1016: Internal Assembler Error


Ps. Incase you are wondering what the point of this code is, the answer is, there is no point, I know of many other ways to do what I am trying to do that works fine. The above is a translation of tutorial code from a Wrox Professional Assembly Language Book.

hutch--

Mike,

I don't know what this has to do with the MASM32 October version, it is a potential problem with ML.EXE. While ML covers most problems, it is not particularly hard to construct examples that will generate tis error, often if you redirect the /EP output to a file you will see the error type referenced to COFFEMIT.C at the bottom of the list.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MusicalMike

I wasn't saying that it was a problem with the october release, but was implying that it was a "problem" that was still present as the october release. Since I know many "better" ways to write the above code, I should probably say, I don't believe its worth investigating. Thanks

raymond

The use of code such as:

fld 43.65

has never been (and probably never will be) accepted by the MASM assembler (i.e. ML.EXE) which is part and parcel of the MASM32 package. Many macros have been posted to circumvent that "problem" which generally consist in initializing a variable in the data section and then accessing that variable with the fld instruction. It is certainly not a "bug".

(MusicalMike: You probably know how to code it correctly but this post is aimed to those who may not yet be familiar with the FPU set of instructions allowed by the MASM assembler.)

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

MusicalMike

I know, but I didn't want to retype the whole .data section where I correctly labeled 80 bit blocks of memory containing the respective floating point values, but didn't want to retype it, and it was late, and I was too tired to think to copy/paste the code.