How to use Nasm assembler on Windows [duplicate] - windows

This question already has answers here:
How to install NASM in windows 10?
(2 answers)
How to add a folder to `Path` environment variable in Windows 10 (with screenshots)
(2 answers)
Closed 4 months ago.
The code doesn’t work and VS Code says there is no support for the language (Nasm), even though I am using multiple extensions for it as well as the assembler from the official site (nasm.us).
I have tried to use the Netwide Assembler (Nasm) on Visual Studio Code. I have downloaded the following extensions: GNU Assembler Language Support, Nasm Language Support, nasm x86 syntax highlighting, The Netwide Assembler (NASM) and x86 and x86_64 assembly
and the compiler from the official site for the assembler (``nasm.us). I have VS Code on my external drive, so I downloaded the compiler on both C:\Program Files (NASM), C: (nasm-2.15.05), as well as on D: (nasm-2.15.05-win32). The error message I got for trying to compile the program from Visual Studio by typing nasm -f win32 (program) in the terminal was:
nasm : The term 'nasm' is not recognized as a cmdlet, function, script file, or operable program name. Check the spelling of the name or, if a path has been included, see if the path
is correct and try again.
On line:1 character:1
+ nasm -f win32 hello.asm
+ ~~~~
+ CategoryInfo : ObjectNotFound: (nasm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Related

realgcc.exe: error: CreateProcess: No such file or directory [duplicate]

This question already has answers here:
Yet Another MinGW "gcc: error: CreateProcess: No such file or directory"
(9 answers)
Closed 4 years ago.
I am trying to run a command that will compile an ada program. I installed the ada compiler through MinGW on Windows 10 64 bit. the command I write exactly is
gcc -c .\stack.adb
the MinGW bin is in my path, and I can compile C code just fine with gcc, I only get the error in the title when I try to compile ada.
You need to install gcc-ada package if you are using Cygwin, then everything will work.
As Jim Rogers said - GNAT GPS is much better options to make Ada projects and is free to use

MinGW GCC wildcard

I'm using MinGW GCC compiler on windows how to compile all C files in a directory.
I used
gcc *.c -o Output
after I entered the required folder and I got this error
gcc: error: *.c: Invalid argument
gcc: fatal error: no input files
compilation terminated.
the used version of GCC is 4.7.1
For anyone else like me who's come across this problem:
I ran into this problem when I installed MinGW-w64 on my tablet after having run it for a few years on my desktop.
Basically, I have a ruby script that does some basic compilation stuff for me, and it was breaking at the linking stage on my tablet (developed on, and ran fine on the desktop).
The error: Invalid Argument, no input files (as in the original question).
If you check around, you'll find a few places that tell you that the issue is due to the way CMD on Windows handles passing wildcards to programs (vs UNIX shells).
Basically Windows leaves interpretation of the wildcard up to the program.
Some builds of MinGW can handle a wildcard from CMD, whereas others won't.
I'm able to use wildcards using the MinGW-W64-builds installer for MinGW-W64.
This should work with older mingw-w64 versions:
#ifdef __MINGW64_VERSION_MAJOR
int _dowildcard = -1; /* enable wildcard expansion for mingw-w64 */
#endif

pc asm book trying to compile first asm app

I can't compile first asm exe
i have MSVC 2005 & 2015
i execute
nasm -f win32 first.asm (ok)
cl first.obj driver.c asm_io.obj (cl not found i set path enviro,
second attempt -> many obj files not found i found it and copy to
source folder,
third attempt ->
asm_io.obj : error LNK2001: unresolved external symbol _scanf
asm_io.obj : error LNK2001: unresolved external symbol _printf
)
using djgpp can't understand what i need to download
downloaded mingw and there is no gcc exe
MSVC does not come with the NASM assembler. You'll need to download that separately, if you do not already have it installed.
MSVC does, however, come with the MASM assembler. You can find steps on how to set it up to work with the IDE here. The problem is, NASM and MASM are not perfectly compatible, syntax-wise. Someone who knows assembly could translate between them trivially, but you will probably have difficulty learning from a book that uses different syntax than your assembler accepts.
Aside from that, I am not sure why you are trying to compile the code after you have assembled it. That is not necessary, and actually won't do anything useful. nasm is an assembler; you run it to assemble assembly code. cl is a C and C++ compiler; you run it to compile c and cpp files. You never need to use cl or gcc when you are writing assembly.

Convert exe files to ASM files in Windows

I just wanna convert .exe to .asm , so how can I accomplish this ?!
It seems that it is available in Decompiling EXE to ASM
but it is for linux .
objdump is included in gcc, and there are Windows ports for gcc like MinGW-w64. Just download it and use.
Alternatively install Cygwin, which is a Unix subsystem on Windows, and run objdump in it
Another tool is Microsoft DUMPBIN which is included in MS Visual Studio
Related: How to use/install GNU binutils (objdump)

How to make gcc accept spaces in path

I'm trying to build qt5 with gcc on Windows, but I came across following problem:
I have path to directx sdk: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010), and this g++ cannot deal with it, I'm getting:
How to overcome this?
It's not gcc's fault, it's your shell/terminal/builder program that's passing all of those as separate arguments. Add some "" around it on on your command line. It's already correct for the earlier copy of that -L flag on the command line you've shown.

Resources