• Complain

Zhirkov - Low-level programming C, assembly, and program execution on Intel 64 architecture

Here you can read online Zhirkov - Low-level programming C, assembly, and program execution on Intel 64 architecture full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA;New York, year: 2017, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Zhirkov Low-level programming C, assembly, and program execution on Intel 64 architecture
  • Book:
    Low-level programming C, assembly, and program execution on Intel 64 architecture
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2017
  • City:
    Berkeley;CA;New York
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Low-level programming C, assembly, and program execution on Intel 64 architecture: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Low-level programming C, assembly, and program execution on Intel 64 architecture" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Explains Intel 64 architecture as the result of von Neumann architecture evolution. The book teaches the latest version of the C language (C11) and assembly language from scratch. It covers the entire path from source code to program execution, including generation of ELF object files, and static and dynamic linking. Code examples and exercises are included along with the best code practices. Optimization capabilities and limits of modern compilers are examined, enabling you to balance between program readability and performance. The use of various performance-gain techniques is demonstrated, such as SSE instructions and pre-fetching. Relevant Computer Science topics such as models of computation and formal grammars are addressed, and their practical value explained--Page 4 of cover

Zhirkov: author's other books


Who wrote Low-level programming C, assembly, and program execution on Intel 64 architecture? Find out the surname, the name of the author of the book and a list of all author's works by series.

Low-level programming C, assembly, and program execution on Intel 64 architecture — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Low-level programming C, assembly, and program execution on Intel 64 architecture" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Part I
Assembly Language and Computer Architecture
Igor Zhirkov 2017
Igor Zhirkov Low-Level Programming 10.1007/978-1-4842-2403-8_1
1. Basic Computer Architecture
Igor Zhirkov 1
(1)
Saint Petersburg, Russia
This chapter is going to give you a general understanding of the fundamentals of computer functioning. We will describe a core model of computation, enumerate its extensions, and take a closer look at two of them, namely, registers and hardware stack. It will prepare you to start assembly programming in the next chapter.
1.1 The Core Architecture
1.1.1 Model of Computation
What does a programmer do? A first guess would probably be construction of algorithms and their implementation. So, we grasp an idea, then we code, and this is the common way of thinking.
Can we construct an algorithm to describe some daily routine, like going out for a walk or shopping? The question does not sound particularly hard, and many people will gladly provide you with their solutions.
However, all these solutions will be fundamentally different. One will operate with such actions as opening the door or taking the key; the other will rather leave the house, omitting details. The third one, however, will go rogue and provide a detailed description of the movement of his hands and legs, or even describe his muscle contraction patterns.
The reason those answers are so different is the incompleteness of the initial question .
All ideas (including algorithms) need a way to be expressed. To describe a new notion we use other, simpler notions. We also want to avoid vicious cycles, so the explanation will follow the shape of a pyramid. Each level of explanation will grow horizontally. We cannot build this pyramid infinitely, because the explanation has to be finite, so we stop at the level of basic, primitive notions, which we have deliberately chosen not to expand further. So, choosing the basics is a fundamental requirement to express anything.
It means that algorithm construction is impossible unless we have fixed a set of basic actions, which act as its building blocks.
Model of computation is a set of basic operations and their respective costs.
The costs are usually integer numbers and are used to reason about the algorithms complexity via calculating the combined cost of all their operations. We are not going to discuss computational complexity in this book.
Most models of computation are also abstract machines . It means that they describe a hypothetical computer, whose instructions correspond to the models basic operations. The other type of models, decision trees, is beyond the scope of this book.
1.1.2 von Neumann Architecture
Now let us imagine we are living in 1930s, when todays computers did not yet exist. People wanted to automate calculations somehow, and different researchers were coming up with different ways to achieve such automation. Common examples are Churchs Lambda calculus or the Turing machine. These are typical abstract machines, describing imaginary computers.
One type of machine soon became dominant: the von Neumann architecture computer.
Computer architecture describes the functionality, organization, and implementation of computer systems. It is a relatively high-level description, compared to a calculation model, which does not omit even a slight detail.
von Neumann architecture had two crucial advantages : it was robust (in a world where electronic components were highly unstable and short-lived) and easy to program.
In short, this is a computer consisting of one processor and one memory bank, connected to a common bus. A central processing unit (CPU) can execute instructions, fetched from memory by a control unit . The arithmetic logic unit (ALU) performs the needed computations. The memory also stores data. See Figures .
Figure 1-1 von Neumann architectureOverview Figure 1-2 von Neumann - photo 1
Figure 1-1.
von Neumann architectureOverview
Figure 1-2 von Neumann architecture Memory Following are the key features - photo 2
Figure 1-2.
von Neumann architecture Memory
Following are the key features of this architecture:
  • Memory stores only bits (a unit of information, a value equal to 0 or 1).
  • Memory stores both encoded instructions and data to operate on. There are no means to distinguish data from code: both are in fact bit strings.
  • Memory is organized into cells, which are labeled with their respective indices in a natural way (e.g., cell #43 follows cell #42). The indices start at 0. Cell size may vary (John von Neumann thought that each bit should have its address); modern computers take one byte (eight bits) as a memory cell size. So, the 0-th byte holds the first eight bits of the memory, etc.
  • The program consists of instructions that are fetched one after another. Their execution is sequential unless a special jump instruction is executed.
Assembly language for a chosen processor is a programming language consisting of mnemonics for each possible binary encoded instruction (machine code). It makes programming in machine codes much easier, because the programmer then does not have to memorize the binary encoding of instructions, only their names and parameters.
Note, that instructions can have parameters of different sizes and formats.
An architecture does not always define a precise instruction set, unlike a model of computation.
A common modern personal computer have evolved from old von Neumann architecture computers, so we are going to investigate this evolution and see what distinguishes a modern computer from the simple schematic in Figure .
Note
Memory state and values of registers fully describe the CPU state (from a programmers point of view). Understanding an instruction means understanding its effects on memory and registers.
1.2 Evolution
1.2.1 Drawbacks of von Neumann Architecture
The simple architecture described previously has serious drawbacks .
First of all, this architecture is not interactive at all. A programmer is limited by manual memory editing and visualizing its contents somehow. In the early days of computers, it was pretty straightforward, because the circuits were big and bits could have been flipped literally with bare hands.
Moreover, this architecture is not multitask friendly. Imagine your computer is performing a very slow task (e.g., controlling a printer). It is slow because a printer is much slower than the slowest CPU. The CPU then has to wait for a device reaction a percentage of time close to 99%, which is a waste of resources (namely, CPU time).
Then, when everyone can execute any kind of instruction, all sorts of unexpected behavior can occur. The purpose of an operating system (OS) is (among others) to manage the resources (such as external devices) so that user applications will not cause chaos by interacting with the same devices concurrently. Because of this we would like to prohibit all user applications from executing some instructions related to input/output or system management.
Another problem is that memory and CPU performance differ drastically.
Back in the old times, computers were not only simpler: they were designed as integral entities. Memory, bus, network interfaceseverything was created by the same engineering team. Every part was specialized to be used in this specific model. So parts were not destined to be interchangeable. In these circumstances none tried to create a part capable of higher performance than other parts, because it could not possibly increase overall computer performance.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Low-level programming C, assembly, and program execution on Intel 64 architecture»

Look at similar books to Low-level programming C, assembly, and program execution on Intel 64 architecture. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Low-level programming C, assembly, and program execution on Intel 64 architecture»

Discussion, reviews of the book Low-level programming C, assembly, and program execution on Intel 64 architecture and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.