NASM - The Netwide Assembler

NASM Forum => Announcements => Topic started by: Manos on June 05, 2015, 12:22:22 PM

Title: wcc32
Post by: Manos on June 05, 2015, 12:22:22 PM
Hi all.

I implemented a new plain ANSI  C optimizing compiler that supports C99
and targets on Windows 32 bit programming.
This compiler does not use any assembler as a backend, but supports
inline assembly in NASM syntax, emits NASM assembly code and
accepts NASM assembly source, also.
That is, with wcc32 you can mix c code and NASM assembly code
together to produces applications.

Since  wcc32 C compiler has the above attributes for NASM,
I thinked to do this post here.

Anyone who is interested, can download this from here (http://www.manoscoder.gr/w32cc/index.php).

Manos.
Title: Re: wcc32
Post by: shaynox on June 06, 2015, 03:13:28 PM
Hello,

How can you not use assembler for produce opcodes ?
Title: Re: wcc32
Post by: encryptor256 on June 06, 2015, 04:20:21 PM
Hello,

How can you not use assembler for produce opcodes ?

Well... assembler is an extra layer, like a separate thing.

He produces machine code directly while parsing C code.

At least, I think so.

P.S.

Try his "CoderStudio" it boots up in a fraction of the second (Hehe... F*** YOOOU Microsoft Visual Studio, we have Manos with CoderStudio),
only problem encountered - I was unable to compile dialog application source into exe.
Title: Re: wcc32
Post by: shaynox on June 06, 2015, 04:53:26 PM
But, are we agree to say opcode is just a hard translation of mnemonic term to binary command, so finally, it needed to translate the high level command to the low level command.


PS: I use the Intel compiler for his performance and his asm production far better compared to some existent compiler even if they should take nasm syntax :p
Title: Re: wcc32
Post by: Manos on June 06, 2015, 06:16:35 PM
Hi shaynox.

encryptor256 is right.

There is a table of OPCODE structures.
This structure has three members: operands, value and flags,(machine values), like:

OPCODE popn_aaa[] =
{
    {
        OP_CODEONLY, 0x0037, 0x0000
    }
    ,
    {
        0, 0, 0
    }
    ,
};
OPCODE popn_aad[] =
{
    {
        OP_CODEONLY, 0x0ad5, 0x0200
    }
    ,
    {
        0, 0, 0
    }
    ,
};
etc.

When the compiler writes the object code, use the above table.

To encryptor256:
CoderStudio has a bug that is easy to correct.
I 'll adapt CoderStudio to support wcc32 and wlink32 soon.
This is because I worked on wcc32, wlink32, header files, libraries and testing these,
for 6 months and for 5 hours  per day and with David Lindauer help.

Manos.

Title: Re: wcc32
Post by: shaynox on June 06, 2015, 06:21:41 PM
But aaa and aad are asm instruction, so you translate C code into asm code, but in streaming no ?
Title: Re: wcc32
Post by: Manos on June 06, 2015, 06:37:26 PM
But aaa and aad are asm instruction, so you translate C code into asm code, but in streaming no ?

Of cource, aaa and aad are asm instructions, but popn_aad and popn_aad
are symbols for the compiler.
The compiler first translates the C code in its symbols and then generate
either machine code directly or emits assembly code.

I think that MS C compiler does not use any assembler, also.

Manos.
Title: Re: wcc32
Post by: shaynox on June 06, 2015, 06:44:17 PM
ok, well I guess others compilers need asm production, for the simply reason that we can get the asm file by -S (gcc) - /FAs (icl - ms compiler) and not other languages, I think.

And for the IDE, it crash when I try to create new project, i'm on win 8.1 x64
Title: Re: wcc32
Post by: Manos on June 06, 2015, 07:26:55 PM
ok, well I guess others compilers need asm production, for the simply reason that we can get the asm file by -S (gcc) - /FAs (icl - ms compiler) and not other languages, I think.

If you wish, download my package from here (http://www.manoscoder.gr/w32cc/index.php).
You will find an example.
If you type: wcc32 /S Demo.c
wcc32 will emits assembly code, (NASM syntax), with C commented code, instead of object file.
Then you can assembly this code using NASM assembler.

Manos.
Title: Re: wcc32
Post by: shaynox on June 06, 2015, 07:38:36 PM
Very interesting, like that I will able to easier translate C code in nasm.

What is __imp__ prefix in function's name ? icl do that too

Will you support c++ too ?

PS: I try to assemble the asm produce by your compiler.

So I have a problem about entry point, when I try to assemble the obj file, I don't know what is the entry point so I searched and found _WinMain@16 into asm/obj produce, but GoLink don't found (Specified entry point (_WinMain) was not found.)

Else linking with wlink32 work perfectly.

I have a lot of warning, but two kind of demo.c when I try to assemble it with nasm:
- 1018: warning: label alone on a line without a colon might be in error:
Code: [Select]
L_56
DB "Demo"
DB 00H

- 892: warning: uninitialised space declared in non-BSS section `.data': zeroing:
Code: [Select]
RESB 04H
Title: Re: wcc32
Post by: Manos on June 06, 2015, 08:58:35 PM
What is __imp__ prefix in function's name ? icl do that too
This __imp__ prefix resolves directly to the Import Adress Table entry, rather than to the JMP stub.

Quote
Will you support c++ too ?
No. I program for many years in C++, but I prefer plain C.
If you are interested for C++, in my forum there is the LADSoft Orange C/C++ compiler.

Quote
PS: I try to assemble the asm produce by your compiler.

So I have a problem about entry point, when I try to assemble the obj file, I don't know what is the entry point so I searched and found _WinMain@16 into asm/obj produce, but GoLink don't found (Specified entry point (_WinMain) was not found.)

Else linking with wlink32 work perfectly.

My Demo.c is for a GUI application and wlink32 has that option by default.
In other linkers you should add the switch: /SUBSYSTEM:WINDOWS
Also, if you take unresolved external symbols,  in linker command line
you should add: msvcrt.lib

Quote
I have a lot of warning, but two kind of demo.c when I try to assemble it with nasm:
- 1018: warning: label alone on a line without a colon might be in error:
Code: [Select]
L_56
DB "Demo"
DB 00H

- 892: warning: uninitialised space declared in non-BSS section `.data': zeroing:
Code: [Select]
RESB 04H

I 'll fix this very soon.
But, since this forum is for discussion about NASM,
I don't have the right to discuss here about my package.
There is my own forum for this work here (http://www.manoscoder.gr/w32cc/index.php).

Manos.
Title: Re: wcc32
Post by: shaynox on June 06, 2015, 09:01:33 PM
ok, and for configure golink (default window app, but it's not important, cause I have success to build window through console application with golink and icl), I have already write good parameters:

Code: [Select]
/entry _WinMain 1.ASM/test/source.obj C:\Windows\System32\kernel32.dll C:\Windows\System32\user32.dll C:\Windows\System32\gdi32.dll C:\Windows\System32\msvcrt.dll C:\Windows\System32\Comctl32.dll

except the entry name.
Title: Re: wcc32
Post by: Manos on July 04, 2015, 09:26:49 AM
New version of wcc32.

Now wcc32 emits correct  NASM code.
Anyone can download without registration.

Manos.
Title: Re: wcc32
Post by: Emil_halim on October 29, 2018, 10:26:51 AM
Hi all

Is aby one has the source of wcc32 , the link is not found.

thanks.
Title: Re: wcc32
Post by: Manos on October 29, 2018, 11:04:18 AM
Hi.

The new link is: http://manoscoder.gr/coderstudio/index.php

Manos.
Title: Re: wcc32
Post by: Emil_halim on October 29, 2018, 12:23:13 PM

thank you very much , will check it out.
Title: Re: wcc32
Post by: Emil_halim on October 29, 2018, 06:36:39 PM

Hi

I have Register in your site but did not get any mail to confirmed the registration.

Also l check my spam , get nothing.

Any help please?
Title: Re: wcc32
Post by: Manos on October 29, 2018, 07:51:05 PM
Now you can register.
Try again.

Manos.
Title: Re: wcc32
Post by: Emil_halim on October 29, 2018, 08:18:14 PM

when trying to reregister I got this Message Error

Quote
Sorry, but you're not allowed to register multiple accounts at the same time from the same computer.
Title: Re: wcc32
Post by: Manos on October 29, 2018, 08:59:35 PM
Do not register again.
Just do login if you don't have already.

Manos.