← Back to context

Comment by tralarpa

7 years ago

> It is acceptable to require a very small amount of assembly code, for example to implement something like memcpy or bcopy, or to provide atomic operations.

There is some stuff missing in your list: preparing the stack pointer, address layout, etc. You also need tools to produce text and data sections that can be loaded at a specific address. Even if C is a low level language, there is still quite some stuff between it and the "bare hardware". In that sense, the only language that gives you enough control to produce the binary exactly in the form needed by the hardware (without relying on external tools or libraries) is assembly.

> You also need tools to produce text and data sections that can be loaded at a specific address.

Though, of course, most compilers provide extensions that make this task generally possible within C (using the loose definition of "I don't need any separate files or inline assembly, just attributes and flags).

  • So we're getting closer to it. The linker inputs and scripts are the only "real" systems programming language.

stack pointer is an implementation detail. The standard does not mention the word stack even once.