Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Notes de cours

Computersystemen aantekeningen week 5-7

Note
-
Vendu
-
Pages
12
Publié le
17-10-2024
Écrit en
2024/2025

Alle hoorcolleges samengevat en een paar aantekeningen uit werkcolleges. Perfect als cheatsheet voor de endterm van Computersystemen.

Établissement
Cours









Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Établissement
Cours
Cours

Infos sur le Document

Publié le
17 octobre 2024
Nombre de pages
12
Écrit en
2024/2025
Type
Notes de cours
Professeur(s)
Inconnu
Contenu
Toutes les classes

Sujets

Aperçu du contenu

HC7 Computer Systems

- CPU evolution
• The x86-64 architecture is a Complex Instruction Set Computer (CISC): many different instructions with
different formats (RISC on lower level)
◦ Intel Core i9-13900K has 8 P-Cores (performance cores) and 16 E-Cores (efficient cores)
• Moore’s law: “number of transistors in CPUs will double every year, for the next 10 years”
◦ Actually: number of transistors has doubled every 18 months, for the next 50 years

- From C to executable → Converting high-level code to machine executable
• Converting C code in hello.c to the executable code hello has several
intermediate steps:
◦ First the compiler converts hello.c to human-readable x86-64 assembly
code hello.s
◦ Next the GNU assembler gas can expand the assembly code to the object
code hello.o. The object code is a binary encoding of assembly
instructions but misses the links to other code parts and to the OS.
◦ Finally the linker will combine the object code with other object code files
and the necessary OS libraries to produce the executable code

• Assembly instructions range in length from 1 to 15 bytes
• Why should we learn assembly?
◦ Code in high-level programming languages is easier to debug and
maintain
◦ Compilers can produce fairly optimized assembly code
◦ Code in high-level languages can be easily transferred to different devices, while assembly is
machine-specific

- Assembly basics
• To interact with the CPU and the memory of the computer system we will
learn the Instruction Set Architecture (ISA)
• Using the x86-64 ISA we can interact with the computer system without
knowing the microarchitecture i.e. the circuit-level details
• The register file stores a small amount of data that we need to process.
The memory stores the code and further data needed.
• The Arithmetic Logic Unit (ALU) carries out all types of instructions:
arithmetic computations, memory/peripheral access and others


- Register File
• The 8086 architecture had 8 registers %ax, %bx, ..., %sp storing 16 bits each
• Their lower 8-bit parts of these registers %al, %bl, ..., %spl were also accessible

• The addb instruction will add the contents of registers
%al and %bl and store the result in %bl
• This addition operates on 8-bit integers thus we put the
suffix b (byte) after the add




! floating point arithmetic is distinct from integer arithmetic

, - Moving Data → between the register file and the ALU
• Using the mov we can copy-paste data from a source location to a destination location.
• mov instruction format; the source and destination operands of the mov instruction are registers:
◦ mov[suffix] Register, Register
• The suffix must match the size of the register, the following instructions are invalid:
◦ movq %ebx, %rcx; we try to get 8 bytes from a 4-byte register
◦ movq %rcx, %ebx; we try to put 8 bytes to a 4-byte register
◦ movl %ebx, %rcx; we try to put 4 bytes to an 8-byte register
• Be careful with register overflow
◦ movb $255, %al; %al = 0xff
◦ movb $257, %al; %al = 0x01 due to truncation

- Memory → Fetching data from/to the memory
• The flat memory model:
every cell has a 64-bit address (264 bytes)

• Indirect memory addressing: access the memory address using ()
◦ movq (%rbx), %rdx →
• We can also use the reverse mov instruction to store to memory.
The following will transfer 4 bytes from %edx to the address stored in
%rbx.
◦ movl %edx, (%rbx)

• Base & displacement memory addressing:
• Let the base address %r11 = 0x00000000000000a2 and
%rax = 0x0000000000000004. The following instructions adjust
the base with an immediate offset and a register index →
◦ movw -3(%r11, %rax), %cx;


• Scaled indexed memory addressing:
• Let the base address %r11 = 0x00000000000000a0 and
%rax = 0x0000000000000002. Consider the following instruction:
◦ movl -5(%r11, %rax, 4), %ecx
◦ mov[suffix] Immediate(Base, Index, Scale), Destination
• The effective address is computed using the formula:
◦ Address = Immediate + Base + Scale * Index,
with Scale = 1,2,4,8
3,49 €
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
immederoever

Faites connaissance avec le vendeur

Seller avatar
immederoever Universiteit van Amsterdam
S'abonner Vous devez être connecté afin de pouvoir suivre les étudiants ou les formations
Vendu
4
Membre depuis
2 année
Nombre de followers
3
Documents
17
Dernière vente
2 année de cela

0,0

0 revues

5
0
4
0
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions