Which assembler would you recommend?

I'm very interested in hardware-oriented programming, i.e., the interface between software and hardware (as well as firmware implementation). I'm already fairly familiar with C and C++ (I'm still learning).

Now I'd like to start with assembly (at least for a quick introduction, since more high-level languages ​​are being used these days), but I see that there are different variations? NASM, Gnu Assembler, MASM/TASM…

Which one would you recommend? Especially in terms of firmware, general-purpose devices (e.g., embedded systems), and more modern programming. Which one is the most popular?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
7 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
tunik123
3 months ago

The assembler language depends very strongly on the processor. One should adhere to its specifications, which usually provides a suitable assembler.

KarlRanseierIII
3 months ago

The ISA is of course CPU-specific.

GAS of course has the advantage that it is on the one hand GCC backend, on the other hand available for various platforms and a whole A. full of ISAs.

I can’t judge what this looks like at MASM, YASM and consorts.

AlterMannNB
3 months ago

You can also program in C Hardwarenah. For the usual microcontrollers, there are specially adapted compilers that support access to all registers of the hardware. These compilers are often free of charge from the manufacturer of the MCUs.

Hardware close to a current PC will usually fail to get documentation.

In earlier times, however, I did it, Turbo Pascal also allowed it, and even offered an inline assembler.

Kelec
3 months ago
Reply to  AlterMannNB

For the usual microcontrollers, there are specially adapted compilers that support access to all registers of the hardware.

This has nothing to do with the compiler. This also supports the normal gcc for x86 and desktop processors.

What makes you a line through the bill is the OS and the respective protection of it, but it has nothing to do with the compiler.

AlterMannNB
3 months ago
Reply to  Kelec

Well, I think it’s hard to create a hardware-related program with a gcc for x86, for example, Renesas microcontrollers of the RX230 family or an Infineon LX. It is not even possible to create it correctly, already due to the lack of register definitions.

If there was one for everything, I would not have had to learn about it so often in the more than 30 years I worked with it every day.

Microcontrollers usually do not have an OS and the protective functions that may be present, e.g. against reading from the code, the programmer must activate itself.

Kelec
3 months ago

Well, I think it’ll be hard to create a hardware program with a gcc for x86

Then there should not be Linux. This is compiled with the gcc and is quite close to hardware.

It is not even possible to create it correctly, even due to the lack of register definitions.

It has nothing to do with the compiler, but they are in support headerfiles that the manufacturer offers or you read them from the data sheet. They are a maximum part of the toolchain for the respective application.

These things are also known for x86 processors or nobody could write an OS for it.

If there was one for everything, I would not have had to learn about it so often in the more than 30 years I worked with it every day.

So I’ve been working with the gcc for both x86 and ARM for 15 years, and the compiler always remains the same even if it naturally produces other machine code. Only the Vendorlibraries and processors are different.

Microcontrollers usually do not have an OS and the protective functions that may be present, e.g. against reading from the code, the programmer must activate itself.

It is also clear, but you can program x86 processors exactly as Baremetal as well as other processors.

For a processor e.g. the old Z80, this is even extremely simple. And even with x86 it is not even so hard to make any basic things without OS. Also gives enough books and websites where this is described

Of course there are differences between individual toolchains. The combination Compiler + Libraries + Linker is different. A Windows toolchain will of course not be suitable to compile a baremetal program.

Kelec
3 months ago

Assembler is not an own language but the direct writing of machine code.

What you are talking about are so-called Macroassemblers that simplify access to libraries, etc., but also here the commands depend on the respective processor.

So assembler on arm is completely different from the x86 architecture and also between different arm variants like Cortex-M and Cortex-A e.g. there are differences.

In principle, however, you can do everything with C and C++ that you can also use assembler only that you do not have to worry about the architecture as long as you do not use any inline assembler.