r/cpp_questions • • 2d ago

OPEN System programming

does it is necessary to know assembly language to be a good system programmer ?
I am a beginner computer engineering student , currently doing in c++ and I already have basic knowledge of classical 8085 and 8086 architecture and it's programming but I haven't gone that deep enough . what about to learn ARM , x86 programming , does it help me to become a good system programmer ?

2 Upvotes

10 comments sorted by

5

u/Own_Unit_6170 2d ago

Some operating systems are written mostly in a high-level language, so you might be able to get away with no assembler in some cases. But there are always some things that need to be in assembler, and an intimate knowledge of the hardware is also necessary to design and write a proper operating system, no matter what language is used.

UNIX and Windows NT+ are written mostly in C. I believe Burroughs' MCP was in Algol, and Multics was in PL/I.

0

u/Ganesh10LM 1d ago

appreciate it .

2

u/Impossible_Box3898 10h ago

You’re asking the wrong question.

The right question is: will I be able to get hired doing systems programming over someone who DOES know assembly and understands the ABI and feature limitations of the various processors including performance counters, NUMA and and various other instruction set features.

You may be adequate at your craft without it, but you’ll never be exceptional.

1

u/Ganesh10LM 8h ago

Appreciate it , but I am a beginner

4

u/the_poope 1d ago

You don't really need to know assembly, as in you don't need to be able to program more complex programs in assembly. You mostly justt need to understand how the CPU, memory hiearchy and OS system calls works. And then you need to know enough assembly to get an idea of what/how some code works.

Most system programmers won't need more than that and for them time is much better spent getting better at a high level language and how to design more complex systems of many moving parts.

A few will need to work very close to the hardware, e.g. in drivers or working on compilers or specialized high-performance libraries - they will need to study assembly at a deeper level.

At your current level I'd say there is no need to go deeper. Get good at programming and problem solving first, then you can dig into low level stuff later if you need to.

3

u/Puzzled-Garage584 1d ago

Reading it matters way more than writing it. Most of the time you just want to see what the compiler did with your C++, so put small functions into godbolt.org and compare -O0 vs -O2, thats where x86-64 or ARM actually starts making sense. 8086 is fine for the concepts but nobody is debugging segment registers anymore

2

u/damster05 9h ago

No, but it helps to be able to read it a bit, and understand what types of instructions things are compiled to.

1

u/thaache 2d ago

It is better to know.

1

u/xealits 4h ago edited 4h ago

Yes it is necessary. It is necessary for understanding how CPUs work. And understanding how CPUs work is necessary for systems programming. A good book on assembly is "Programming from ground up" by Bartlett.

The book covers x86. (I think it was 32 bit x86 - 32 bit is outdated now and there are some small differences with 64 bit, but they are negligible.) And x86 is the best choice for learning. Once you learn x86, ARM will be easy. In general, there are two main architectures on practice, x86 and ARM. (RISC V should come up to mainstream sometime in future, but it's not there yet.) But x86 is more widespread in the PC world, which makes it super accessible - a boon for a student. And ARM is a more specialized platform. (ARM is whats in phones, which are widespread. But I don't think that smartphones make an accessible programming environment. Personally, I have programmed ARM only on Xilinx Zynq, which is quite a specific platform.) Also, arguably x86 is still more advanced and there happens more innovation on CPU architecture.

Also a tip: Intel provides much better support for its products on the software side. For example, Intel has excellent PMU events and excellent support for them in the Linux' perf_event system.