Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Computer Systems: A Programmer's Perspective Chapter 3

Rating
5.0
(1)
Sold
6
Pages
28
Uploaded on
20-09-2020
Written in
2020/2021

This is a summary of Computer Systems: A Programmer's Perspective Chapter 3: Machine-Level Representation of Programs by Randal E. Bryant and David R. O’Hallaron.

Institution
Course

Content preview

Computer Systems: a Programmer’s
Perspective
Randal E. Bryant en David R. O’Hallaron


Chapter 3 – Machine-Level Representation of
Programs
Computers execute machine code, sequence of bytes encoding the low-level operations that
manipulate data, manage memory, read and write data on storage devices, and communicate over
networks. A compiler generates machine code through a series of stages, based on the rules of the
programming language, the instruction set of the target machine, and the conventions followed by
the operating system. The GCC C compiler generates its output in the form of assembly code, a
textual representation of the machine code giving the individual instructions of the program. GCC
then invokes both an assembler and a linker to generate the executable machine code from the
assembly code.

When programming in a high-level language such as C, we are shielded from the detailed machine-
level implementation of our program. In contrast, when writing programs in assembly code, a
programmer must specify the low-level instructions the program uses to carry out a computation.
Working on high is level is most of the time more productive and reliable. Type checking provided by
a compiler helps detect many program errors and makes sure we reference and manipulate data in
consistent ways. A program written in a high-level language can be compiled and executed on a
number of different machines, whereas assembly code is highly machine specific.

Still, it is important to know a bit of assembly code. By reading assembly code, we can understand
the optimization capabilities of the computer and analyze the underlying inefficiencies in the code.
Sometimes the high-level language hides information about the run-time behavior of a program. This
information can be seen on machine-code level and can be used to prevent attacks on programs.

To understand assembly language, we'll need to understand the transformations typical compilers
make in converting the constructs of C into machine code. Optimizing compilers can rearrange
execution order of C code, eliminate unneeded computations, replace slow operations with faster
ones, and even change recursive computations into iterative ones. It is a form of reverse engineering
– trying to understand the process by which a system was created by studying the system and
working backward. To understand assembly language, just the general principles will not suffice:
you'll need the details as well.

Assembly language is rather peculiar, because it was made by two rivals (Intel and AMD) and only
makes sense when viewed from a historical perspective.

3.1 - A Historical Perspective
The Intel processor line x86 started with one of the first single-chip 16-bit microprocessors. Since
then, it has been improved and improved again. To see a list of all Intel processors from the first to
now, read page 195 – 196.

Each successive processor has been designed to be backward compatible- able to run code compiled
for any other version. Due to this, there are many strange artifacts in the instruction set due to this
evolutionary heritage. The most recent processor from Intel is Intel64, the 64-bit extension to IA32

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Hoofdstuk 3
Uploaded on
September 20, 2020
Number of pages
28
Written in
2020/2021
Type
SUMMARY

Subjects

$4.14
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Reviews from verified buyers

Showing all reviews
4 year ago

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
cilevanmarken Universiteit van Amsterdam
Follow You need to be logged in order to follow users or courses
Sold
191
Member since
7 year
Number of followers
166
Documents
11
Last sold
3 weeks ago

3.9

44 reviews

5
15
4
15
3
10
2
1
1
3

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions