<s>
A	O
low-level	B-Language
programming	I-Language
language	I-Language
is	O
a	O
programming	O
language	O
that	O
provides	O
little	O
or	O
no	O
abstraction	B-Application
from	O
a	O
computer	O
's	O
instruction	B-General_Concept
set	I-General_Concept
architecture	I-General_Concept
—	O
commands	O
or	O
functions	O
in	O
the	O
language	O
map	O
that	O
are	O
structurally	O
similar	O
to	O
processor	O
's	O
instructions	O
.	O
</s>
<s>
Generally	O
,	O
this	O
refers	O
to	O
either	O
machine	B-Language
code	I-Language
or	O
assembly	B-Language
language	I-Language
.	O
</s>
<s>
Because	O
of	O
the	O
low	O
(	O
hence	O
the	O
word	O
)	O
abstraction	B-Application
between	O
the	O
language	O
and	O
machine	B-Language
language	I-Language
,	O
low-level	B-Language
languages	I-Language
are	O
sometimes	O
described	O
as	O
being	O
"	O
close	O
to	O
the	O
hardware	O
"	O
.	O
</s>
<s>
Programs	O
written	O
in	O
low-level	B-Language
languages	I-Language
tend	O
to	O
be	O
relatively	O
non-portable	B-Architecture
,	O
due	O
to	O
being	O
optimized	O
for	O
a	O
certain	O
type	O
of	O
system	O
architecture	O
.	O
</s>
<s>
Low-level	B-Language
languages	I-Language
can	O
convert	O
to	O
machine	B-Language
code	I-Language
without	O
a	O
compiler	B-Language
or	O
interpreter	B-Application
—	O
second-generation	O
programming	O
languages	O
use	O
a	O
simpler	O
processor	O
called	O
an	O
assembler	B-Language
—	O
and	O
the	O
resulting	O
code	O
runs	O
directly	O
on	O
the	O
processor	O
.	O
</s>
<s>
A	O
program	O
written	O
in	O
a	O
low-level	B-Language
language	I-Language
can	O
be	O
made	O
to	O
run	O
very	O
quickly	O
,	O
with	O
a	O
small	O
memory	O
footprint	O
.	O
</s>
<s>
An	O
equivalent	O
program	O
in	O
a	O
high-level	B-Language
language	I-Language
can	O
be	O
less	O
efficient	O
and	O
use	O
more	O
memory	O
.	O
</s>
<s>
Low-level	B-Language
languages	I-Language
are	O
simple	O
,	O
but	O
considered	O
difficult	O
to	O
use	O
,	O
due	O
to	O
numerous	O
technical	O
details	O
that	O
the	O
programmer	O
must	O
remember	O
.	O
</s>
<s>
By	O
comparison	O
,	O
a	O
high-level	B-Language
programming	I-Language
language	I-Language
isolates	O
execution	O
semantics	B-Application
of	O
a	O
computer	O
architecture	O
from	O
the	O
specification	O
of	O
the	O
program	O
,	O
which	O
simplifies	O
development	O
.	O
</s>
<s>
Machine	B-Language
code	I-Language
is	O
the	O
only	O
language	O
a	O
computer	O
can	O
process	O
directly	O
without	O
a	O
previous	O
transformation	O
.	O
</s>
<s>
Currently	O
,	O
programmers	O
almost	O
never	O
write	O
programs	O
directly	O
in	O
machine	B-Language
code	I-Language
,	O
because	O
it	O
requires	O
attention	O
to	O
numerous	O
details	O
that	O
a	O
high-level	B-Language
language	I-Language
handles	O
automatically	O
.	O
</s>
<s>
True	O
machine	B-Language
code	I-Language
is	O
a	O
stream	O
of	O
raw	O
,	O
usually	O
binary	O
,	O
data	O
.	O
</s>
<s>
A	O
programmer	O
coding	O
in	O
"	O
machine	B-Language
code	I-Language
"	O
normally	O
codes	O
instructions	O
and	O
data	O
in	O
a	O
more	O
readable	O
form	O
such	O
as	O
decimal	B-Application
,	O
octal	O
,	O
or	O
hexadecimal	O
which	O
is	O
translated	O
to	O
internal	O
format	O
by	O
a	O
program	O
called	O
a	O
loader	B-Operating_System
or	O
toggled	O
into	O
the	O
computer	O
's	O
memory	O
from	O
a	O
front	B-Device
panel	I-Device
.	O
</s>
<s>
Although	O
few	O
programs	O
are	O
written	O
in	O
machine	B-Language
languages	I-Language
,	O
programmers	O
often	O
become	O
adept	O
at	O
reading	O
it	O
through	O
working	O
with	O
core	B-Error_Name
dumps	I-Error_Name
or	O
debugging	O
from	O
the	O
front	B-Device
panel	I-Device
.	O
</s>
<s>
Example	O
of	O
a	O
function	O
in	O
hexadecimal	O
representation	O
of	O
32-bit	O
x86	B-Operating_System
machine	B-Language
code	I-Language
to	O
calculate	O
the	O
nth	O
Fibonacci	B-Algorithm
number	I-Algorithm
:	O
</s>
<s>
Second-generation	O
languages	O
provide	O
one	O
abstraction	B-Application
level	O
on	O
top	O
of	O
the	O
machine	B-Language
code	I-Language
.	O
</s>
<s>
In	O
the	O
early	O
days	O
of	O
coding	O
on	O
computers	O
like	O
TX-0	B-Device
and	O
PDP-1	B-Device
,	O
the	O
first	O
thing	O
MIT	O
hackers	O
did	O
was	O
to	O
write	O
assemblers	B-Language
.	O
</s>
<s>
Assembly	B-Language
language	I-Language
has	O
little	O
semantics	B-Application
or	O
formal	O
specification	O
,	O
being	O
only	O
a	O
mapping	O
of	O
human-readable	O
symbols	O
,	O
including	O
symbolic	O
addresses	B-General_Concept
,	O
to	O
opcodes	B-Language
,	O
addresses	B-General_Concept
,	O
numeric	O
constants	O
,	O
strings	O
and	O
so	O
on	O
.	O
</s>
<s>
Typically	O
,	O
one	O
machine	B-Language
instruction	I-Language
is	O
represented	O
as	O
one	O
line	O
of	O
assembly	B-Language
code	I-Language
.	O
</s>
<s>
Assemblers	B-Language
produce	O
object	B-Application
files	I-Application
that	O
can	O
link	B-Application
with	O
other	O
object	B-Application
files	I-Application
or	O
be	O
loaded	B-Operating_System
on	O
their	O
own	O
.	O
</s>
<s>
Most	O
assemblers	B-Language
provide	O
macros	O
to	O
generate	O
common	O
sequences	O
of	O
instructions	O
.	O
</s>
<s>
Example	O
:	O
The	O
same	O
Fibonacci	B-Algorithm
number	I-Algorithm
calculator	O
as	O
above	O
,	O
but	O
in	O
x86-64	O
assembly	B-Language
language	I-Language
using	O
AT&T	O
syntax	O
:	O
</s>
<s>
In	O
this	O
code	O
example	O
,	O
hardware	O
features	O
of	O
the	O
x86-64	O
processor	O
(	O
its	O
registers	B-General_Concept
)	O
are	O
named	O
and	O
manipulated	O
directly	O
.	O
</s>
<s>
The	O
function	O
loads	O
its	O
input	O
from	O
%edi	O
in	O
accordance	O
to	O
the	O
System	O
V	O
ABI	O
and	O
performs	O
its	O
calculation	O
by	O
manipulating	O
values	O
in	O
the	O
EAX	O
,	O
EBX	O
,	O
and	O
ECX	O
registers	B-General_Concept
until	O
it	O
has	O
finished	O
and	O
returns	O
.	O
</s>
<s>
Note	O
that	O
in	O
this	O
assembly	B-Language
language	I-Language
,	O
there	O
is	O
no	O
concept	O
of	O
returning	O
a	O
value	O
.	O
</s>
<s>
The	O
result	O
having	O
been	O
stored	O
in	O
the	O
EAX	O
register	O
,	O
the	O
RET	O
command	O
simply	O
moves	O
code	O
processing	O
to	O
the	O
code	O
location	O
stored	O
on	O
the	O
stack	B-General_Concept
(	O
usually	O
the	O
instruction	O
immediately	O
after	O
the	O
one	O
that	O
called	O
this	O
function	O
)	O
and	O
it	O
is	O
up	O
to	O
the	O
author	O
of	O
the	O
calling	O
code	O
to	O
know	O
that	O
this	O
function	O
stores	O
its	O
result	O
in	O
EAX	O
and	O
to	O
retrieve	O
it	O
from	O
there	O
.	O
</s>
<s>
x86-64	O
assembly	B-Language
language	I-Language
imposes	O
no	O
standard	O
for	O
returning	O
values	O
from	O
a	O
function	O
(	O
and	O
in	O
fact	O
,	O
has	O
no	O
concept	O
of	O
a	O
function	O
)	O
;	O
it	O
is	O
up	O
to	O
the	O
calling	O
code	O
to	O
examine	O
state	O
after	O
the	O
procedure	O
returns	O
if	O
it	O
needs	O
to	O
extract	O
a	O
value	O
.	O
</s>
<s>
Compare	O
this	O
with	O
the	O
same	O
function	O
in	O
C	B-Language
,	O
a	O
high-level	B-Language
language	I-Language
:	O
</s>
<s>
This	O
code	O
is	O
very	O
similar	O
in	O
structure	O
to	O
the	O
assembly	B-Language
language	I-Language
example	O
but	O
there	O
are	O
significant	O
differences	O
in	O
terms	O
of	O
abstraction	B-Application
:	O
</s>
<s>
The	O
input	O
(	O
parameter	O
n	O
)	O
is	O
an	O
abstraction	B-Application
that	O
does	O
not	O
specify	O
any	O
storage	O
location	O
on	O
the	O
hardware	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
C	B-Language
compiler	B-Language
follows	O
one	O
of	O
many	O
possible	O
calling	O
conventions	O
to	O
determine	O
a	O
storage	O
location	O
for	O
the	O
input	O
.	O
</s>
<s>
The	O
assembly	B-Language
language	I-Language
version	O
loads	O
the	O
input	O
parameter	O
from	O
the	O
stack	B-General_Concept
into	O
a	O
register	O
and	O
in	O
each	O
iteration	O
of	O
the	O
loop	O
decrements	O
the	O
value	O
in	O
the	O
register	O
,	O
never	O
altering	O
the	O
value	O
in	O
the	O
memory	B-General_Concept
location	I-General_Concept
on	O
the	O
stack	B-General_Concept
.	O
</s>
<s>
The	O
C	B-Language
compiler	B-Language
could	O
load	O
the	O
parameter	O
into	O
a	O
register	O
and	O
do	O
the	O
same	O
or	O
could	O
update	O
the	O
value	O
wherever	O
it	O
is	O
stored	O
.	O
</s>
<s>
Which	O
one	O
it	O
chooses	O
is	O
an	O
implementation	O
decision	O
completely	O
hidden	O
from	O
the	O
code	O
author	O
(	O
and	O
one	O
with	O
no	O
side	O
effects	O
,	O
thanks	O
to	O
C	B-Language
language	I-Language
standards	O
)	O
.	O
</s>
<s>
The	O
local	O
variables	O
a	O
,	O
b	O
and	O
c	B-Language
are	O
abstractions	B-Application
that	O
do	O
not	O
specify	O
any	O
specific	O
storage	O
location	O
on	O
the	O
hardware	O
.	O
</s>
<s>
The	O
C	B-Language
compiler	B-Language
decides	O
how	O
to	O
actually	O
store	O
them	O
for	O
the	O
target	O
architecture	O
.	O
</s>
<s>
The	O
C	B-Language
compiler	B-Language
for	O
any	O
specific	O
architecture	O
implements	O
a	O
standard	O
mechanism	O
for	O
returning	O
the	O
value	O
.	O
</s>
<s>
Compilers	B-Language
for	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
typically	O
(	O
but	O
not	O
always	O
)	O
use	O
the	O
EAX	O
register	O
to	O
return	O
a	O
value	O
,	O
as	O
in	O
the	O
assembly	B-Language
language	I-Language
example	O
(	O
the	O
author	O
of	O
the	O
assembly	B-Language
language	I-Language
example	O
has	O
chosen	O
to	O
copy	O
the	O
C	B-Language
convention	O
but	O
assembly	B-Language
language	I-Language
does	O
not	O
require	O
this	O
)	O
.	O
</s>
<s>
These	O
abstractions	B-Application
make	O
the	O
C	B-Language
code	O
compilable	O
without	O
modification	O
on	O
any	O
architecture	O
for	O
which	O
a	O
C	B-Language
compiler	B-Language
has	O
been	O
written	O
.	O
</s>
<s>
The	O
x86	B-Operating_System
assembly	B-Language
language	I-Language
code	O
is	O
specific	O
to	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
.	O
</s>
<s>
During	O
the	O
late	O
1960s	O
,	O
high-level	B-Language
languages	I-Language
such	O
as	O
PL/S	B-Language
,	O
BLISS	B-Language
,	O
BCPL	B-Language
,	O
extended	O
ALGOL	B-Language
(	O
for	O
Burroughs	B-Device
large	I-Device
systems	I-Device
)	O
and	O
C	B-Language
included	O
some	O
degree	O
of	O
access	O
to	O
low-level	B-Language
programming	I-Language
functions	O
.	O
</s>
<s>
One	O
method	O
for	O
this	O
is	O
inline	B-Language
assembly	I-Language
,	O
in	O
which	O
assembly	B-Language
code	I-Language
is	O
embedded	O
in	O
a	O
high-level	B-Language
language	I-Language
that	O
supports	O
this	O
feature	O
.	O
</s>
<s>
Some	O
of	O
these	O
languages	O
also	O
allow	O
architecture-dependent	O
compiler	B-Application
optimization	I-Application
directives	I-Application
to	O
adjust	O
the	O
way	O
a	O
compiler	B-Language
uses	O
the	O
target	O
processor	O
architecture	O
.	O
</s>
