

Assembly
Presentation
•
Computers
•
10th Grade
•
Hard
Emanuela Giaconi
Used 4+ times
FREE Resource
33 Slides • 36 Questions
1
Assembly
By Emanuela Giaconi
2
Assembly e Assembler
assembly: linguaggio di programmazione molto simile al linguaggio macchina
assembler: programma "assemblatore" che converte il linguaggio assembly in linguaggio macchina.
le istruzioni del linguaggio assembly corrispondono alle istruzioni che il processore può eseguire: stringhe di bits (1 o 2 ma anche 4 bytes) che nel linguaggio assembly assumono nomi comprensibili agli umani.
Assembly
3
Assembly
uso di parole chiave:
MOV per assegnare valori ai registri,
ADD per sommare i contenuti dei registri o aree di memoria,
SUB per sottrarre,
...
Assembly
4
Assembler e Linker
la traduzione da assembly a codice macchina prevede due passaggi:
ASSEMBLER: traduzione che non richiede nessuna intelligenza (ad ogni istruzione assembly corrisponde un'istruzione macchina espressa in bit)
LINKER: collegamento di moduli e librerie di cui si compone il programma e distribuzione del codice oggetto nello spazio di indirizzi di memoria centrale assegnato al programma
Assembly
5
Open Ended
Indicare i tipi di architetture che conosci in base al numero di operandi che una macchina può elaborare in un'unica istruzione
6
Istruzione assembly
Istruzione assembly:
label: assegna un nome simbolico all'indirizzo di memoria in cui si trova l'istruzione
opcpde: codice operativo mnemonico che specifica l'operazione
operandi separati da una virgola (da uno a tre): dati su cui operare
Assembly
7
Istruzioni Assembly
tutte le istruzioni hanno un corrispondente opcode (Operation Code) che rappresenta l'istruzione stessa in formato esadecimale o binario.
istruzione che somma 32 al registro EAX
Assembly
8
Istruzioni Assembly
faremo riferimento al set di istruzioni (ISA Instruction Set Architecture) realizzato per i processori Intel 8086 (comaptibili con i processori della famiglia Intel x86) con un'architettura a 16 bit, e con istruzioni a due operandi
Assembly
9
Registri dei processori Intel 8086
5 tipi di registri per un totale di 14 registri tutti a 16 bit
FR: registro del flag
AX, BX, CX e DX: registri di lavoro
DI e SI: registri indice
DS, ES, CS, SS: registri segmento
IP, BP e SP: registri puntatore
Assembly
10
Multiple Choice
Da cosa deriva il nome 8086?
Dai bit
Dagli anni di progettazione
Dal nome dell'inventore
11
Multiple Choice
Da che azienda è stato creato il primo processore 8086?
Apple
Intel
MSI
AMD
12
Multiple Choice
Il processore 8086 da quanti bit è costituito?
8 bit
20 bit
4 bit
16 bit
13
Multiple Choice
Che linguaggio utilizza?
C++
Java
Linguaggio Assembly
C
14
Registro dei flag
Tutte le istruzioni modificano il registro di stato
alcune istruzioni richiedono che prima venga letto il registro di stato (esecuzione dipende dal contenuto del registro di stato)
Assembly
15
Registro dei flag
6 flag di stato e 3 di controllo:
CF (Carry Flag): 1 in presenza di riporto in seguito a operazioni sulla ALU
PF (Parity Flag): bit di parità, settato a 1 per avere un numero pari di bit a 1 nel dato. Rilevazione degli errori in trasmissione
AF (Auxiliary Flag): prestito per operazioni sui nibble (4 bit)
Assembly
16
Registro dei flag
ZF (Zero Flag): 1 quando il risultato di un'operazione aritmetica è 0, altrimenti è resettato a 0
SF (Sign Flag): 1 quando il risultato di un'operazione aritmetica è negativo, altrimenti è resettato a 0
Assembly
17
Registro dei flag
OF (Overflow Flag): 1 segnala un "traboccamento", risultato di un'operazione aritmetica che occupa il bit dedicato al segno, risultato dimensioni superiori a quelle predisposte
TF (Trap Flag): 1 quando si esegue un programma in debug
IF (Interrupt Flag): 1 quando si abilitano gli interrupt
DF (Direction Flag): 1 per indirizzi di memoria decrescenti
Assembly
18
Multiple Choice
In che consiste il registro flag?
Immagazzina i dati
Consiste in un gruppo di bit che consentono di ottenere delle informazioni sui risultati dell'ultima operazione aritmetico-logica eseguita
Svolge calcoli matematici
Show answersPreviousNext
19
Registri di lavoro
AX, BX, CX, DX a 16 bit
usati anche a 8 bit per volta indicando la parte alta (AH, BH, CH, DH) per gli 8 bit più significativi, o la parte bassa (AL, BL, CL, DL)
Assembly
20
Registri segmento
A ogni programma in esecuzione vengono assegnati 4 segmenti (aree di memoria della memoria centrale da 64kB nell'Intel 8086) per contenere dati, istruzioni e indirizzi
segmento dati: contiene i dati necessari al programma
segmento extra: contiene in generale dati che necessitano più byte (ad es floating point)
segmento codice: contiene le istruzioni macchina del programma
segmento stack: contiene indirizzi di ritorno delle subroutine
Assembly
21
Registri segmento
I registri segmento DS (Data Segment), ES (Extra Segment), CS (Code Segment) e SS (Stack Segment) contengono gli indirizzi iniziali delle rispettive aree
Assembly
22
Registri indice
I registri indice vengono usati per operare su strutture dati array o string
SI (Source Index): contiene l'indice della stringa o array che si sta leggendo
DI (Destination Index): contiene l'indice della stringa o array in cui si sta scrivendo
i dati si trovano nel segmento dati, DI e SI lavorano in copia con DS. DS indica l'indirizzo iniziale del segmento dati, mentre in SI e DI ci sarà il numero di byte in cui bisogno spostarsi all'interno del segmento per ottenere il dato da elaborare
Assembly
23
Registri puntatori
IP (Instruction Pointer): contiene offset che a partire dall'inizio del segmento codice permette di indirizzare l'istruzione macchina in esecuzione
IP lavora in coppia con CS
Subroutine: raggruppamenti di istruzioni che possono essere richiamate quando occorre tramite un nome simbolico. L'indirizzo di ritorno della subroutine viene salvato nello stack
Assembly
24
Registri puntatori - Subroutine
Assembly
BP (Base Pointer): punta all'inizio dell'area di memoria riservata alla subroutine all'interno dello stack
SP (Stack Pointer): punta alla cima dell'area di memoria riservata alla subroutine all'interno dello stack
25
Registri - Coppie celebri
CS: Code Segment
IP: Instruction Pointer
DS: Data Segment
DI: Destination Index
SI: Source Index
SS: Stack Segment
BP: Base Pointer
SP: Stack Pointer
26
Set di istruzioni - Uso generale
Assembly
27
Set di istruzioni - I/O
Assembly
28
Set di istruzioni - Op Aritmetiche
Assembly
29
Set di istruzioni - Op Aritmetiche
Assembly
30
Set di istruzioni - Op logiche
Assembly
31
Set di istruzioni - Op subroutine
32
Set di istruzioni - Salto condizionato
33
Set di istruzioni - Salto condizionato
34
Set di istruzioni - Loop
35
Set di istruzioni - Loop
36
Interrupt
Le istruzioni di I/O coinvolgono le periferiche che comunicano con la CPU (chiedono la sua attenzione) tramite interrupt
37
Interrupt
38
Interrupt
39
Interrupt
40
Multiple Select
What kind of code does an assembler take as input?
object code
bytecode
high level program code
assembly language code
machine code
41
Multiple Select
What kinds of code might an assembler output?
object code
bytecode
high level program code
assembly language code
machine code
42
Multiple Choice
Where is object code stored?
main memory
secondary storage
in the programmer's mind
on paper
43
Multiple Choice
Define instruction set
The complete collection of instruction that are understood by CPU
The complete collection of instruction that are understood by human
The complete collection of instruction that are understood by student
The complete collection of instruction that are understood by binary
44
Multiple Select
Allister just learned about language in subject Computer System Architecture. SELECT level of language that friendly to human also understand by computer system.
Low Level - machine language
Middle Level - assembly language
High Level - high level language
Intermediate Level - middle language
45
Fill in the Blanks
Type answer...
46
Multiple Choice
Define Machine Language
A sequence of instruction and operand in binary that list the exact representation instruction as they appear in computer memory
A sequence of instruction and operand in hexadecimal that list the exact representation instruction as they appear in computer memory
A sequence of instruction and operand in binary that list the exact representation instruction as they appear in cache memory
A sequence of instruction and operand in hexadecimal that list the exact representation instruction as they appear in register memory
47
Multiple Select
CHOOSE the best to represent Machine Language
Programmers need to know specifically the architecture of CPU
Middle Level Language
Program written in any other language must be translated to binary representation of instruction before they can be executed by computer.
Strings of numbers or binary codes (0 or 1)
48
Multiple Select
SELECT the best to represent Instruction set
The complete collection of instructions that are understood by a CPU
Instruction set usually represented by assembly code
known as Machine Instruction or Machine Code
a low level programming language used to directly control a computer's central processing unit (CPU)
49
Multiple Choice
Define mnemonic
Immediate remembered code
Low remembered code
Easily remembered code
Harder remembered code
50
Multiple Choice
Krishna use english-like abbreviations (MUL), (ADD), (SUB).
Pick Language Krishna used.
Computer Language
High Level Language
Assembly Language
Low Level Language
51
Multiple Choice
Define Assembly Language
Middle Level Language
Symbolic representation of a machine language of specific processor
Message sent by programmers (program instructions) understood by the computer and vice versa.
Natural language of a particular computer system.
52
Multiple Choice
What is the correct arrangement of programming languages in the order of understandability by humans?
4, 3, 2, 1
1, 2, 3, 4
1, 3, 2, 4
1, 3, 4, 2
53
Multiple Choice
Machine codes are written in what form?
Binary or hexadecimal
Opcodes such as ADD, MOV, SUB, etc.
Mnemonics
Binary only
54
Multiple Choice
Which type of programming language uses codes such as ADD, MOV and DEL?
High-level programming language
Assembly language
Machine code
Human language
55
Multiple Choice
Consider the instruction: ADD AX, 08h. What represents the opcode?
ADD
AX, 08h
08h
AX
56
Multiple Choice
Which of the following is NOT a register?
Accumulator
Program counter
MAR
Mnemonic
57
Multiple Choice
Which of the following register performs the calculations and stores the result?
Accumulator
Program counter
MAR
Mnemonic
58
Multiple Choice
In which of the following instruction operands are not specified?
DAT
STA
INP
ADD
59
Multiple Choice
What value is present in ACC if LDA direct 6 instruction is executed?
6
4
16
14
60
Multiple Choice
Every computer processor has the same instruction set
True
False
61
Multiple Choice
What are the 2 parts of the instruction?
Opinstruction and Opmemory
Opcommand and Opstate
Opcode and Operand
Opcommand and Opmemory
62
Multiple Choice
63
Multiple Choice
What translates assembly code into machine code?
compiler
assembler
linker
loader
interpreter
64
Multiple Choice
65
Multiple Choice
Each assembly instruction usually has an address or data called an
opcode
operand
mnemonic
instruction set
66
Multiple Choice
67
Multiple Choice
What Mnemonic is used for Addition in Assembly
ADD
ADS
ODD
IDD
68
Multiple Choice
What Mnemonic is used in Assembly to stop the program
HLT
STO
STP
STA
69
Multiple Choice
What Mnemonic is used to Subtract in Assembly
SUB
SBU
SBB
SUU
Assembly
By Emanuela Giaconi
Show answer
Auto Play
Slide 1 / 69
SLIDE
Similar Resources on Wayground
61 questions
JURNAL PENYESUAIAN AKUTANSI PERUSAHAAN JASA
Presentation
•
11th Grade
65 questions
Le Basi di Dati
Presentation
•
11th Grade
63 questions
Tabel periodik
Presentation
•
10th Grade
67 questions
ATMOSFER
Presentation
•
10th Grade
65 questions
Indonesia Poros Maritim Dunia
Presentation
•
11th Grade
63 questions
Review Materi Resensi 11
Presentation
•
11th Grade
Popular Resources on Wayground
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
10 questions
Cinco de Mayo Trivia Questions
Interactive video
•
3rd - 5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
13 questions
Cinco de mayo
Interactive video
•
6th - 8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
30 questions
GVMS House Trivia 2026
Quiz
•
6th - 8th Grade