Quote:
but i could not seem to find the syntax. i tried but i always get an error.
Advice: Never do this, not like that!
The code in your comment show that you do not understand what you do, and it is a good thing that you get errors.
This piece of code:
0x00401410 <+0>: push %ebp
0x00401411 <+1>: mov %esp,%ebp
0x00401413 <+3>: and $0xfffffff0,%esp
0x00401416 <+6>: sub $0x10,%esp
0x00401419 <+9>: call 0x401950 <__main>
0x0040141e <+14>: movl $0x405044,(%esp)
0x00401425 <+21>: call 0x403a90 <printf>
0x0040142a <+26>: mov $0x0,%eax
0x0040142f <+31>: leave
0x00401430 <+32>: ret
is not autonomous, there are 2 calls to the standard library functions and you can see that 'Hello, world!' is not there.
Quote:
I have converted C code into Assembly code using MinGW (GDB) in CMD.
No, you have disassembled executable in memory, it is useful to understand what is doing a program but can't be used to make another program.
Advice: ask the compiler to generate assembly file as it compile your code, you will see that the assembly is not the same.
To do what you want, you need a very good understanding of differences in both languages:
- Registers usage
- Calling convention
- Naming scheme of routines in library
This kind of activity is for seasoned programmer, and there is very few cases where there a gain.