The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ecube on May 02, 2010, 05:11:11 AM

Title: Convert some HLA
Post by: ecube on May 02, 2010, 05:11:11 AM
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;
Title: Re: Convert some HLA
Post by: MichaelW on May 02, 2010, 05:30:44 AM
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
Title: Re: Convert some HLA
Post by: ecube on May 02, 2010, 05:32:31 AM
thanks, yeah I just found that second before you pasted actually, the qwords are in different spots, does that matter?
Title: Re: Convert some HLA
Post by: MichaelW on May 02, 2010, 05:34:21 AM
For a union the order should not matter.
Title: Re: Convert some HLA
Post by: ecube on May 02, 2010, 05:41:35 AM
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.