Vous êtes sur la page 1sur 4

Exercitiul 1.

.model small
.data
x db 0
z db 31h
.code

main proc

mov bl,30h
Lp:
mov ah,1
int 21h
inc bl

cmp al,20h
je ie
jmp Lp

ie:
mov x,bl
mov bl,z
sub x,bl
add x,30h
mov ah,2
mov dl,x
int 21h

main endp
end main

Exectitiul 2.

.model small
.data
.code
main proc
mov dl,52h

mov ah,02h
int 21h
mov ax, 4c00h
int 21h

main endp
end main

Exercitiul 3
Exercitiul 4

.model small
.data
msg1 db 10,13,'Introduceti o valoare hexazecimala:$'
msg2 db 10,13,'Valoarea introdusa este in zecimal:$'
msg3 db 10,13,'Doriti sa introduceti inca o valoare?$'
msg4 db 10,13,'Introduceti doar numere intre 0-9 sau A-F:$'

.code

iar:

mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,9
int 21h

mov ah,1
int 21h

mov bl,al

jmp go

go:

cmp bl,'9'
ja hex
jb num
je num

hex:

cmp bl,'F'
ja gresit

lea dx,msg2
mov ah,9
int 21h

mov dl,49d
mov ah,2
int 21h

sub bl,17d
mov dl,bl
mov ah,2
int 21h

jmp inp

inp:

lea dx,msg3
mov ah,9
int 21h

mov ah,1
int 21h

mov cl,al
cmp cl,'y'
je iar
cmp cl,'Y'
je iar
jmp exit

num:

cmp bl,'0'
jb gresit

lea dx,msg2
mov ah,9
int 21h

mov dl,bl
mov ah,2
int 21h

jmp inp

gresit:

lea dx,msg4
mov ah,9
int 21h

mov ah,1
int 21h

mov bl,al
jmp go

end