NASM - The Netwide Assembler
NASM Forum => Announcements => Topic started 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.
-
Hello,
How can you not use assembler for produce opcodes ?
-
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.
-
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
-
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.
-
But aaa and aad are asm instruction, so you translate C code into asm code, but in streaming no ?
-
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.
-
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
-
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.
-
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:
L_56
DB "Demo"
DB 00H
- 892: warning: uninitialised space declared in non-BSS section `.data': zeroing:
RESB 04H
-
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.
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.
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
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:
L_56
DB "Demo"
DB 00H
- 892: warning: uninitialised space declared in non-BSS section `.data': zeroing:
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.
-
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:
/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.
-
New version of wcc32.
Now wcc32 emits correct NASM code.
Anyone can download without registration.
Manos.
-
Hi all
Is aby one has the source of wcc32 , the link is not found.
thanks.
-
Hi.
The new link is: http://manoscoder.gr/coderstudio/index.php
Manos.
-
thank you very much , will check it out.
-
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?
-
Now you can register.
Try again.
Manos.
-
when trying to reregister I got this Message Error
Sorry, but you're not allowed to register multiple accounts at the same time from the same computer.
-
Do not register again.
Just do login if you don't have already.
Manos.