News:

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

Convert some HLA

Started by ecube, May 02, 2010, 05:11:11 AM

Previous topic - Next topic

ecube

how do you convert this to MASM


type
    bignum:
        union
            tot     :qword;
            record
                lo      :dword;
                hi      :dword;
            endrecord;
        endunion;


he's using it like


qwFileSize      :bignum;

MichaelW

I think it should be something like the LARGE_INTEGER union from the MASM32 windows.inc:

LARGE_INTEGER UNION
  STRUCT
    LowPart  DWORD ?
    HighPart DWORD ?
  ENDS
  QuadPart QWORD ?
LARGE_INTEGER ENDS
eschew obfuscation

ecube

thanks, yeah I just found that second before you pasted actually, the qwords are in different spots, does that matter?

MichaelW

For a union the order should not matter.
eschew obfuscation

ecube

alright thanks a lot MichaelW the purpose of this is i'm converting evenbits "Mem Map files up to 18 exabytes" example, as I feel this functions long overdue and is really useful. Most people think they can just map a view of an entire multi gig file and that's OK, but that's definitely not the way to do it, and ReadFile in a loop is bad too as I/O is slow and takes a toll on the hardware for many reads.  Though I wonder if thats faster than unmapview and remaping another view in the loop as this code does, which I know gives you a speed penality. Guess i'll have to speed test after to see using your macros :) oh btw not that it's in your control but your speed testing code definitely can be dangerous, I learned that the hard way by setting the loopcount too high, and consider the processes priority.