Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exercice 1
- Donner la traduction en assembleur des différentes expressions :
- 1) z := x + y 2) y := d – x 3) x := a + b – c 4) x := a - b + c 3)
- z = y+ X
- mov tmp0,x
- add tmp0,y
- mov z,tmp0
- y= d-x
- mov tmp0,x
- sub tmp0,d
- mov y,tmp0
- x = a+b-c
- mov tmp0,c
- sub tmp0,b
- add tmp0,a
- mov x,tmp0
- 2) SI (e1 = e2) ALORS r :=1 SINON r :=0 FIN_SI
- cmp e1,e2
- jne sin
- mov r,1
- jmp fin
- sin: mov r,0
- fin:
- mov ah,4ch
- int 21h
- 3) Exercice 2 Écrire un programme assembleur qui lit et affiche un caractère.
- mov dl,65
- mov ah,2
- int 21h
- mov ah,4ch
- int 21h
- 4) Exercice 3 Écrire un programme assembleur qui affiche l’alphabet en majuscule.
- mov dl,64
- mov cx,0
- boucle:
- cmp cx,26
- je fin
- inc cx
- inc dl
- mov ah,2
- int 21h
- jmp boucle
- fin:
- mov ah,4ch
- int 21h
- 5) Exercice 4 : Écrire un programme qui affiche la série de nombres suivante {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
- mov dl,'/'
- mov cx,0
- boucle:
- cmp cx,10
- je fin
- inc cx
- inc dl
- mov ah,2
- int 21h
- jmp boucle
- fin:
- mov ah,4ch
- int 21h
- 6) Exercice 5 : Écrire un programme permettant la saisie et l'affichage tant que le caractère saisi est différent de A (code ASCII 65).
- mov dl,'A'
- boucle:
- mov ah,1
- int 21h
- cmp dl,ah
- jne boucle
- je fin
- fin:
- mov ah,4ch
- int 21h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement