You are on page 1of 6

TP2 architecture des ordinateurs

Exercice 1  :
Title exercice 1
data segment
Var1 DB 5 dup(5)
Var2 DW 4 dup(6),13
V1 DB 12
V2 DB 50
ends
stack segment
ends
code segment
start:
mov ax, data
mov ds, ax
mov ax,0
mov al,V1
mov ah,V2
mov V1,ah
mov V2,al
ends
end start

Exercice 2  :
Title exercice 2
data segment
Var1 DB 5 dup(5)
Var2 DW 4 dup(6),13
V1 DW 12
V2 DW 50
ends
stack segment
ends
code segment
start:
mov ax, data
mov ds, ax
mov ax,0
mov ax,V1
mov bx,V2
mov V1,ax
mov V2,bx
ends
end start

Exercice 3  :
Title exercice 3
data segment
var1 DB 12
var2 DB 50
ends
stack segment
ends
code segment
start:
mov ax, data
mov ds, ax
mov ax,0
mov al,var1
mul var2
mov ax,0
mov var1,120
mov ah,var1
div var2
ends
end start

Exercice 4  :
Title : exercice 4
data segment
tab DB 14h,30h,50h
somme DB ?
ends
stack segment
ends
code segment
start:
mov ah,02
mov dl, tab[0]
int 21h
mov ah,02
mov dl, tab[1]
int 21h
mov al,tab[0]
mov ah,tab[1]
mov tab[0],ah
mov tab[1],al
mov ah,02
mov dl, tab[0]
int 21h
mov ah,02
mov dl, tab[1]
int 21h
mov ax,0
mov al,tab[0]
mov bl,tab[1]
add bl
mov ah,tab[2]
add bl
mov somme,bl
ends
end start
Exercice 5  :
title ex5
data segment
tab DW 50,100,450
somme DW 0
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov ax,0h
mov bx,0h
mov ax,50
mov bx,100
mov tab[0],bx
mov tab[2],50
add somme,50
add somme,100
add somme,450
ends
end start

You might also like