News:

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

WINDOWS.INC for ML.EXE Version 8.0

Started by hutch--, July 10, 2006, 01:34:59 PM

Previous topic - Next topic

hutch--

The plot thickens. Trying to get a reliable RECORD format I get this unusual result.


ImportRec RECORD Reserved :11,NameType :3,Type2 :2

dtype UNION
  Ordinal dw  ?
  Hint dw     ?
dtype ENDS

IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?

    itm dtype <>

;     UNION
;         Ordinal dw  ?
;         Hint dw     ?
;     ENDS
    rImport ImportRec <>
IMPORT_OBJECT_HEADER ENDS


The RECORD entry only generates an error if the structure before it is uncommented. I have written it as a test piece with a remote UNION and it builds without error.

Alternatively I can add and exta STRUCT/ENDS around the UNION and it will build with no errors.


IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?

    STRUCT
    UNION
        Ordinal dw  ?
        Hint dw     ?
    ENDS
    ENDS

    rImport ImportRec <>
IMPORT_OBJECT_HEADER ENDS


Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ToutEnMasm

Hello,
I am made some tests .
Visual comparison with my one translator: no errors
Compile with ml 8.0
Two errors coming with new names for the record in the structure
                              ToutEnMasm


;-----------------------------------------------------------------------------------------------
LDTBits RECORD  rBaseHi:8,
Granularity:1,
Default_Big : 1,
Reserved_0:1,
Sys:1,
LimitHi:4,
Pres:1,
Dpl:2,
S_bit:1,
Type1:4,
rBaseMid:8

LDT_ENTRY STRUCT
    LimitLow   dw ?
    BaseLow      dw ?
    union HighWord1
      LDTBits   <>  ;     ???????????  Bytes LDT_BYTES <> ?????????????????????
      Bits LDTBits <>
    ends
LDT_ENTRY ENDS

ImportRec RECORD Reserved : 11,NameType : 3,Type2 : 2

IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?
    union
        Ordinal dw  ?
        Hint dw     ?
    ends
    ImportRec <>   ;     ???????????????? rImport ImportRec <> ??????????????????????
IMPORT_OBJECT_HEADER ENDS

;-------------------------------------------------------------------------------------------------

ToutEnMasm


I have dowloaded the new windows.inc,i will give you soon the result.
Putting the structures you give for testing in data,i see that giving an another name at the record
in the structure,make errors of "bad initialised data".
I don't know if you understand me very well , it will have no renamed record in the all windows.inc.


ToutEnMasm


Ok,no  problems with the new,i have put all the testing structures in data.

ToutEnMasm



An another test,i have deleted the new names of the records in all the structures and added comments in the structures,all is OK.
Ok at compile with structures used in data

ToutEnMasm


results for all test,

when defining a record
example RECORD one:16,two:16

The following structure must must used example to define the DWORD
essai STRUCT
      velo DD ?
       example <>
essai ENDS

If the structure don't make that by adding "New example <>",an error of "incorrect initialised data"
can occured in the structure used in the source.
The error can be on correct designed structure because the report of the error is not very good.
                                             ToutEnMasm







PoorEnglish

I found this in MSDN for VS 2005
Microsoft Macro Assembler Reference 
RECORD (MASM) 

Declares a record type consisting of the specified fields. fieldname names the field, width specifies the number of bits, and expression gives its initial value.


recordname RECORD fieldname:width [[= expression]]
   [[, fieldname:width [[= expression]]]]...

and I use
ImportRec RECORD Reserved : 11,NameType : 3,Type2 : 2

IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?
    union
        Ordinal dw  ?
        Hint dw     ?
    ends
    rImport ImportRec <>,<>,<>
IMPORT_OBJECT_HEADER ENDS

but i don't know why it doesn't error.

beyond5776

Thank U very much!!

Once i migrate my assembly project from ml form 6.0 to 8.0, get sooooo many errors, once replace _windows.inc to yours version, it's work~ :)

:cheekygreen: :cheekygreen: :cheekygreen:

----------------------------------------------------------------------------
Ryan~
http://www.xuyibo.org