The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: remus2k on November 01, 2006, 03:47:06 PM

Title: nasm to masm32 converter?
Post by: remus2k on November 01, 2006, 03:47:06 PM
hi @all

Is there such a thing nasm to masm32 converter?
Title: Re: nasm to masm32 converter?
Post by: Vortex on November 01, 2006, 04:31:54 PM
I am afraid there is no any specialized tool for this purpose, you should do the convertion manually.
Title: Re: nasm to masm32 converter?
Post by: remus2k on November 01, 2006, 07:32:55 PM
i make self translate i have a problem

bc:    resb BE_CONFIG_size  <-- nasm

what is this in masm32 ?

bc  BE_CONFIG_size <>   ??
Title: Re: nasm to masm32 converter?
Post by: PBrennick on November 01, 2006, 10:19:31 PM
bc: is a label and is not a part of the conversion.

resb looks like a macro to me. You will need to find it and include it in the source.

Paul
Title: Re: nasm to masm32 converter?
Post by: Tedd on November 01, 2006, 10:22:07 PM
bc db BE_CONFIG_size dup (?)

Although, if you define BE_CONFIG as a STRUCT, then you can just do
bc BE_CONFIG <?>
which will give space for a single BE_CONFIG struct
Title: Re: nasm to masm32 converter?
Post by: Synfire on November 02, 2006, 01:07:26 AM
Quote from: PBrennickresb looks like a macro to me. You will need to find it and include it in the source.

resb means "Reserve Byte". It's similiar to how dup works:

SECTION .BSS
my_array: resb 2025


It's the same as:

.DATA?
my_array DB 2025 dup(?)


Quote from: TeddAlthough, if you define BE_CONFIG as a STRUCT, then you can just do
bc BE_CONFIG <?>
which will give space for a single BE_CONFIG struct

BE_CONFIG is a STRUCT. the *_size  suffix is defined when a struct is created. Structures in NASM are done by an internal macro, and when they are created an equate is defined containing the size of the structure. This is to emulates the SIZEOF() MASM directive.

mov dword [wc + WNDCLASSEX.cbSize], WNDCLASSEX_size

is the same as:

mov wc.cbSize, SIZEOF(WNDCLASSEX)

Regards,
Bryant Keller
Title: Re: nasm to masm32 converter?
Post by: jack on November 02, 2006, 01:58:11 AM
not exactly what you asked for, but maybe someone could adapt the Perl scripts to do what you want
http://rudy.mif.pg.gda.pl/~bogdro/inne/ and http://www.devoresoftware.com/nomyso/