I see when create a structure first parameter must be Dword for functioning....
If first parameter is declared word ... this parameter keep 4 octets and write 2 octets
Second parameter is written after 4 octets ... even if the first parameter is declared word
Example:
TEST Struct
Param1 DWord ?
Param2 DWord ?
TEST ENDS
Local pertest:TEST
mov pertest.Param1, "AA"
mov pertest.Param2, "BB"
Result of this struct is : "A","A",0,0,"B","B" and will be this ... "A","A","B","B".... right?
Is bug?
Thanks !
Hi costycnc
Not sure, if i understood. Which syntax is this?
It is not for rosasm.
Hi costycnc,
That is probably because the alignment. Try this:
TEST Struct 2 <-- This makes the structure to be word aligned
Param1 Word ?
Param2 Word ?
TEST ENDS
Regards.
for one thing, when you enclose text in immediate data, the letters are reversed
for another thing, when you write a DWORD, but specify less than 4 letters, the upper bytes are 0's
mov dwValue,'ABCD' ;writes 'DCBA'
mov dwValue,'AB' ;writes 'BA',0,0, assuming dwValue is a DWORD
the original post is from last year :biggrin:
it may not have gotten much attention, because we thought it had to do with EasyCode syntax - lol
Quote
I see when create a structure first parameter must be Dword for functioning....
If first parameter is declared word ... this parameter keep 4 octets and write 2 octets
Second parameter is written after 4 octets ... even if the first parameter is declared word
WRONG !
The structure need to be align to work,that all.
Try to modify it is the badest way.
I search a little and give you the answer
Quote
;Include pshpack2.SDK
DEFALIGNMASM TEXTEQU <WORD>
;ECHO region Desktop Family
IF WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
BITMAPFILEHEADER STRUCT DEFALIGNMASM
bfType WORD ?
bfSize DWORD ?
bfReserved1 WORD ?
bfReserved2 WORD ?
bfOffBits DWORD ?
BITMAPFILEHEADER ENDS
correct syntax
Quote
BITMAPFILEHEADER STRUCT WORD
bfType WORD ?
bfSize DWORD ?
bfReserved1 WORD ?
bfReserved2 WORD ?
bfOffBits DWORD ?
BITMAPFILEHEADER ENDS