Extras din laborator
1. Să se realizeze un program care, calculează adunarea, scăderea, înmulţirea şi împărţirea a două numere, iar rezultatul să se pune în memoria RAM.
Varianta 1:
org 100h
mov cx, 500h
mov ds,cx
mov ax,5
mov dx,2
add ax,dx ;aduna cele doua numere si suma pune in ax
mov bx,50h
mov [bx],ax ;rezultatul se pune in memorie la randul 50h
mov ax,5
sub ax,dx ;scade din ax bx-ul si pune in ax
mov bx, 52h
mov [bx],ax
mov ax,5
mul dx ;inmulteste cele doua numere
mov bx,54h
mov [bx],ax
mov ax,5
mov cx,2
div cx ;imparte cele doua numere
mov bx,56h
mov [bx],ax ;in ax este catul
mov bx,58h
mov [bx],dx ;in dx se afla restul
hlt
2. Să se realizeze un program care adună două numere care se găsesc în memoria RAM la adresele 500h:0h şi 501h:0h, iar rezultatul îl pune la adresa 502h:0h.
org 100h
mov ax,500h
mov ds,ax
mov cx,7
mov bx,0
mov [bx],cx
mov dx,3
mov ax,501h
mov ds,ax
mov bx,0
mov [bx],dx
add cx,dx
mov ax,502h
mov ds,ax
mov bx,0
mov [bx],cx
hlt
3. Să se realizeze un program care înmulţeşte două numere care se găsesc în memoria RAM la adresele 500h:0h şi 501h:0h, iar rezultatul se pune în 502h:0h.
org 100h
mov ax,500h
mov ds,ax
mov ax,7
mov bx,0
mov [bx],ax
mov cx,ax
mov dx,3
mov ax,501h
mov ds,ax
mov bx,0
mov [bx],dx
mov ax,502h
mov ds,ax
mov ax,cx
mul dx
mov bx,0
mov [bx],ax
hlt
4. Să se realizeze un program care împarte două numere care, se găsesc în memoria RAM la adresele 500h:0h şi 501h:0h iar, câtul îl pune la adresa 502h:0h şi restul în 503h:0h
org 100h
mov ax,500h
mov ds,ax
mov ax,7
mov [0],ax
mov bx,ax
mov ax,501h
mov ds,ax
mov cx,2
mov [0],cx
mov ax,502h
mov ds,ax
mov ax,bx
div cx
mov [0],ax
mov ax,503h
mov ds,ax
mov [0],dx
hlt
5. Să se realizeze un program care, să calculeze n! punând rezultatele parţiale în memoria RAM, începând de la adresa 500h:0h.
org 100h
mov ax,500h
mov ds,ax
mov ax,1
mov cx,5
eticheta:
mul cx
mov [bx],ax
add bx,1
loop eticheta
hlt
Preview document
Conținut arhivă zip
- Exercitii in EMU8086.doc