assemblyarmopen-sourceintelriscv

Open source and independent ARM and RISC-V assemblers


I'm creating a project and I need INTEL, ARM and RISC-V assemblers that are independent and run on Windows and Linux. For the INTEL architecture, I found the NASM assembler, it fulfills all my requirements, however I cannot find the assemblers for ARM and RISC-V.

The only ARM and RISC-V assemblers I found were from GNU. But to install it you need the entire GNU toolchain, which doesn't seem like a good idea. Besides this toolchain is not available on Windows.

Are there any open source, standalone ARM and RISC-V assemblers available outside of NASM (NASM style would just be a standalone assembler and nothing else)?

Edit1: GNU/MinGW IS NOT INDEPENDENT, it comes with a bunch of other features, like C and C++ linker and compiler, unlike NASM. Also, as far as I know, MinGW does not have the ARM and/or RISC-V assembler, but only the INTEL assembler, which is not useful for me, since I already use NASM.

Edit2: Analyzing has rather gnu toolchain for ARM and RISC-V for Windows, however is there any application that is only an assembler for ARM and RISC-V? I do not want a gnu and clang, but rather just an assembler (an example would be the NASM, which is for INTEL).


Solution

  • Well, from what I realized apparently there is no open source project that focuses exclusively on an ARM assembler and RISC-V. But there are 4 solutions to my problem.

    (1): Use WSL2 on Windows, and on Linux use GNU or LLVM. Because they have several tools, such as multi-platform assemblers, in the case of ARM and RISC-V. This solution is especially useful if you are compiling for Linux using a Windows

    (2): Using LLVM, more specifically clang, it can compile RISC-V and ARM assembly codes. These options are used for this:

    riscv32 --> clang -target riscv32 -c foo.s

    riscv64 --> clang -target riscv64 -c foo.s

    arm32 --> clang -target arm -c foo.s

    arm64 --> clang -target arm64 -c foo.s

    (3): Using GNU, in windows using https://gnutoolchains.com/, and on Linux using apt or similar tools to download the ARM and RISC-V toolchains, and in them comes assemblers.

    (4): Using FASMG and FASMARM.

    FASMG: https://board.flatassembler.net/topic.php?t=19389

    FASMARM: https://arm.flatassembler.net/

    (Extra for Windows): Microsoft itself provides tools such as assemblers to use, in Windows, such as MASM for INTEL and ARMASM for ARM. Because you don't have Windows for RISC-V yet, you don't have a Microsoft RISCVASM.

    MASM --> (https://learn.microsoft.com/en-us/cpp/assembler/masm/masm-for-x64-ml64-exe?view=msvc-170)

    ARMASM --> (https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-reference?view=msvc-170)