Low-level programming language: Difference between revisions

Content deleted Content added
Assembly language: Explain "C".
Line 49:
In this code example, hardware features of the x86-64 processor (its [[Processor register|registers]]) are named and manipulated directly. The function loads its input from ''%edi'' in accordance to the [[x86 calling conventions#System V AMD64 ABI|System V ABI]] and performs its calculation by manipulating values in the '''EAX''', '''EBX''', and '''ECX''' registers until it has finished and returns. Note that in this assembly language, there is no concept of returning a value. The result having been stored in the '''EAX''' register, the '''RET''' command simply moves code processing to the code ___location stored on the stack (usually the instruction immediately after the one that called this function) and it is up to the author of the calling code to know that this function stores its result in '''EAX''' and to retrieve it from there. x86-64 assembly language imposes no standard for returning values from a function (and in fact, has no concept of a function); it is up to the calling code to examine state after the procedure returns if it needs to extract a value.
 
Compare this with the same function in [[C]], a [[high-level language]]:
 
<syntaxhighlight lang="c">