News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

atoflt

Started by jimg, February 28, 2024, 11:43:08 AM

Previous topic - Next topic

jj2007

Quote from: jimg on March 04, 2024, 11:38:05 PMI could be wrong, but it looks to me like hex2bin does not put out a double (64 bit float).

You are perfectly right, Jim - sorry, my fault. Here are results for _strtoui64("1234567890.1234567890", 0, 10, 0)

AMD Athlon Gold 3150U with Radeon Graphics      (SSE4)

17353   cycles for 100 * MasmBasic Val
175059  cycles for 100 * CRT sscanf
24912   cycles for 100 * _strtoui64

18031   cycles for 100 * MasmBasic Val
177988  cycles for 100 * CRT sscanf
25351   cycles for 100 * _strtoui64

17327   cycles for 100 * MasmBasic Val
175367  cycles for 100 * CRT sscanf
26482   cycles for 100 * _strtoui64

17739   cycles for 100 * MasmBasic Val
177129  cycles for 100 * CRT sscanf
24694   cycles for 100 * _strtoui64

18033   cycles for 100 * MasmBasic Val
174206  cycles for 100 * CRT sscanf
24456   cycles for 100 * _strtoui64

9       bytes for MasmBasic Val
18      bytes for CRT sscanf
34      bytes for _strtoui64

Real8   1234567890.123456716    MasmBasic Val
Real8   1234567890.123456716    CRT sscanf
Real8   1234567890.000000000    _strtoui64

TimoVJL

Saving double to hex-format is fixed length and accurate.
May the source be with you

jimg

Okay, here is the "quickie" I've been working on.
It's a simple program lets the user type in or paste a decimal number, an 8 character hex, or a 16 character hex, and converts whats put in to the other two types.  I'm wanted it as a tool for something else I'm working on.  Little did I know it would take a week for such a small, simple program.

Also, Microsoft thinks it's a virus!  I included the source so you can see it's not.  Assemble it yourself.

Microsoft has gotten worse and worse.  Most of my programs are now considered a virus.

So, what's the simplest/smallest patch so it passes the virus test?


okay, minutes later.  There is no where to add an attachment.  When did this happen?

This really feels like a senior moment.  How does one add an attachment now?

jimg

Exactly right, thank you.

Here's the stuff.  Not a polished app, and needs a better sprintf format for decimal, but functional.


edit:   zip removed.

jimg

#34
Okay, I added a worthless manifest to this pig.

Let me know if you are still getting a virus warning.

edit:  zip deleted, new one below

jimg

and while I'm making a total mess here----

Does any know how to fix this warning?

warning LNK4078: multiple ".drectve" sections found with different attributes (00000A00)

How do you give it the same attributes (whatever they are)?

I'm using this manifest-

OPTION DOTNAME
.drectve SEGMENT INFO DISCARD
db "'"
db '-manifestuac:level="requireAdministrator" uiAccess="false" '
db "'"
db '-manifestdependency:type="Win32"'
db ' name="Microsoft.Windows.Common-Controls"'
db ' version="6.0.0.0"'
db ' processorArchitecture="X86"'
db ' publicKeyToken="6595b64144ccf1df"'
db ' language="*"'
db '-manifest:embed'
.drectve ENDS


jj2007

Did you fumble your Windows.inc?

\Masm32\include\windows.inc(156) : Error A2136: Symbol type conflict: BOOL
 \Masm32\include\windows.inc(156): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\windows.inc(12164) : Error A2056: Symbol already defined: Flags
 \Masm32\include\windows.inc(12164): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\windows.inc(12184) : Error A2056: Symbol already defined: Flags
 \Masm32\include\windows.inc(12184): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\windows.inc(16530) : Error A2056: Symbol already defined: hInst
 \Masm32\include\windows.inc(16530): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\windows.inc(16542) : Error A2056: Symbol already defined: hInst
 \Masm32\include\windows.inc(16542): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\windows.inc(23408) : Error A2056: Symbol already defined: GUID
 \Masm32\include\windows.inc(23408): Included by
  Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12329) : Error A2056: Symbol already defined: cStr
 \Masm32\include\winextra.inc(12329): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12795) : Error A2101: Macro nesting level too deep
 \Masm32\include\winextra.inc(12795): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12811) : Error A2101: Macro nesting level too deep
 \Masm32\include\winextra.inc(12811): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12823) : Error A2101: Macro nesting level too deep
 \Masm32\include\winextra.inc(12823): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12841) : Error A2101: Macro nesting level too deep
 \Masm32\include\winextra.inc(12841): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\winextra.inc(12853) : Error A2101: Macro nesting level too deep
 \Masm32\include\winextra.inc(12853): Included by
  \Masm32\include\windows.inc(26889): Included by
   Tmp_File.asm(4): Main line code
\Masm32\include\user32.inc(1731) : Error A2143: Symbol redefinition: TRACKMOUSEEVENT
 \Masm32\include\user32.inc(1731): Included by
  MacroLoop(1): iteration 1: Macro called from
   uselibs(4)[Tmp_File.asm]: Macro called from
    Tmp_File.asm(38): Main line code
\Masm32\include\user32.inc(1811) : Error A2143: Symbol redefinition: MOUSE_EVENT
 \Masm32\include\user32.inc(1811): Included by
  MacroLoop(1): iteration 1: Macro called from
   uselibs(4)[Tmp_File.asm]: Macro called from
    Tmp_File.asm(38): Main line code
\Masm32\include\comctl32.inc(141) : Error A2143: Symbol redefinition: INITCOMMONCONTROLSEX
 \Masm32\include\comctl32.inc(141): Included by
  MacroLoop(1): iteration 3: Macro called from
   uselibs(4)[Tmp_File.asm]: Macro called from
    Tmp_File.asm(38): Main line code
Tmp_File.asm(55) : Error A2143: Symbol redefinition: DLGPROC
Tmp_File.asm(59) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(62) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(65) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(68) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(71) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(74) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(78) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(93) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(111) : Error A2048: Operands must be the same size: 1 - 2
Tmp_File.asm(150) : Error A2142: Unmatched block nesting: DlgProc
Tmp_File.asm: 174 lines, 1 passes, 94 ms, 0 warnings, 26 errors

jimg

I don't think so.  At least I don't get those errors.  Did you slip in another include that conflicts?


My total includes are:

include windows.inc

uselibs user32,kernel32,comctl32,msvcrt,fpu

includelib \masm32\lib\ucrt.lib

jj2007

Quote from: jimg on March 05, 2024, 08:36:22 AMDid you slip in another include that conflicts?

No, and I have over 5,500 sources here that don't produce these errors.
My \Masm32\include\windows.inc is of 10 Jan 2012 and has 977,412 bytes.

The problem sits here:

.686p
.model  flat, stdcall
.nolist
option casemap :none                      ; case sensitive
include windows.inc

Without this line, Flags equals flags (to quote one example). I wonder why it assembles on your machine :rolleyes:

jimg

My windows.inc is dated 1/9/2012

perhaps a newer one might have that problem?

It's a very small program.  I just can't see it.  Can you?

jj2007

option casemap :none solves the problem, see above.

jimg

Well gee.   How did that happen.  Looking over many of my other programs, I have 1933 files with that line.  Magic editing skill at work I guess.  I'll upload a new version.

Thank for finding that, I had no idea what the problem was.

jimg

Latest fix.   This was just meant to be a quickie.  Ridiculous.

NoCforMe

Quote from: jj2007 on March 05, 2024, 09:00:38 AMoption casemap :none solves the problem, see above.
Quote from: jimg on March 05, 2024, 09:06:44 AMWell gee.  How did that happen.  Looking over many of my other programs, I have 1933 files with that line.  Magic editing skill at work I guess.
You might want to consider using masm32rt.inc instead, which includes that statement as welll as other useful stuff.
Assembly language programming should be fun. That's why I do it.

jimg

Thanks for the thought.  I considered it many years ago, and it just hides and loads way too much stuff I don't need, slowing down the compile time.  I'm a little more of a minimalist than that.