Sunteți pe pagina 1din 1

2.

Sa se scrie o secventa de program care programeaza canalul 5 al circ


1. Sa se scrie o secventa de program care programeaza canalul 2 al circ * verificare CPUID DMA pentru un transfer de memorie in mod bloc a 12 kocteti in memorie
DMA pentru un transfer de memorie in mod bloc a 10 kocteti cu Push fd incepand de la adresa AC287h cu drecementarea adresei si
decrementarea adresei. Adresa de inceput este 0B34FAh: Pop eax autoinitializare. DACK, DRQ = 0, impulsul de scriere este intarziat,
mov al, 0Fh – resetare DMAx2 Move ebx,eax prioritate rotativa, ciclu normal de scriere, nu se permite transfer
out 0Dh, al XOE eax,002000000h memorie-memorie si nici mentinerea adresei:
mov al, 00000010b – seteaza reg de comanda x2 Push Eax mov al, 0Fh – resetare DMAx2
out 08h, al Pop fd out 0Dh, al
mov al, 00000110b – seteaza reg cerere software x2 Push fd mov al, 00010000b – seteaza reg de comanda x2
out 09h, al Pop eax out 08h, al
mov al, 00000110b – seteaza reg de masti x2 Cmp eax,ebx mov al, 00000100b – seteaza reg cerere software x2
out 0Ah, al Jz no_cpuid out 09h, al
mov al, 10100110b – seteaza reg de mod x2 mov al, 00000100b – seteaza reg de masti x2
out 0Bh, al * VAL MAX CPUID out 0Ah, al
mov al, 0Fh – mascare cereri DMA x2 Mov eax,800000000h mov al, 10110100b – seteaza reg de mod x2
out 0Fh, al CPUID out 0Bh, al
mov al, 0Bh – reg pagina x2 mov al, 0Fh – mascare cereri DMA x2
out 81h, al * Terminare prg out 0Fh, al
mov al, FAh – ... adresei de inceput x4 Move ax,4c00h mov al, 0Ah – reg pagina x2
out 04h, al Int 21h out 87h, al
mov al, 34h mov al, 87h – ... adresei de inceput x4
out 04h, al * Culoare pe font: out 00h, al
mov al, FFh – contor x4 Mov bh,00h mov al, C2h
out 05h, al Mov bl,01110100b out 00h, al
mov al, 2Fh Mov cx,o1h mov al, FFh – contor x4
out 05h, al out 01h, al
mov al, 00h – demascare cereri DMAx2 mov al, 2Fh
out 0Fh, al out 01h, al
out 08h, al – activare DMA mov al, 00h – demascare cereri DMAx2
out 0Fh, al
out 08h, al – activare DMA
3. Redirectarea unei intreruperi:
mov al, n (nr intreruperii) * semnatura procesorului pe 8 cifre hexa: 4. Redirectarea intreruperii 1Ch:
mov ah, 35h Mov ah,0 mov al, 1Ch
int 21h Mov al,1 mov ah, 35h
ls – adresa de reg din TVI Int 10h int 21h
bx – adresa de offset din TVI Move eax,1 mov irq – old, bx
apoi: 1) citeste intreruperea Cpuid mov irq – old+2, es
2) salvarea adresei Mov ah,0eh push ds
3) scrierea intreruperii Mov cx,8 mov ax, cs
mov al, n Et: mov al,bl mov ds, ax
mov ah, 25h Cmp al,ah mov dx, offset rutina
mov ds, adresa de reg pt noua intrer Jl et2 mov al, 1Ch
mov dx, adresa de offset pt nou intrer Add al,37 = 37+a=41 mov ah, 25h
int 21h Et2:add al,30 int 21h
4) refacerea TVI Int 10h pop ds
mov al, 08h Sar edx,4 mov dx, old
mov ah, 35h Loop et mov ds, old+2
int 21h * 330 de cuvinte de la edma la b8420h mov ah, 25h
mov irq – old, bx Mov al,00000100b mov al, 1Ch
mov irq – old+2, es Out odoh,al int 21h
push ds Mov al,10010111b
mov ax, cs Out od6h,al
mov ds, ax Mov ax,8420 5. Timer 1, numarare binara, mod 3, adresa de start 6342:
mov dx, offset rutina Out occh,al mov al, 01110110b – reg de comanda x2
mov al, 08h Out occh,ah out 43h, al
mov ah, 25h Move al,0bh mov al, 42h
int 21h Out obah,al out 41h, al
pop ds Move ax,300 mov al, 63h
mov dx, old – refacerea TVI x4 Out oceh,al out 41h, al
mov ds, old+2 Out oce,ah
mov al, 08h Move al,00000000b
mov ah, 25h Out odoh,al
int 21h Move al,00000111b out od2h,al
7. Sa se scrie un program care genereaza la difuzorul calc un semnal de
6. Programarea contorului 2 al circ 8153 pt a scoate la difuzor nota LA: * 2 calc legate serial si trasmit abcd f=370hz. Din program se iese cu ESC (1bh), f clk=1,193 MHz (k = fclk/f=
fclk=1,193 MHz, fLA=440Hz (k = fclk/fLA= 1,193M / 440 = 2711): 1,193M / 370):
mov al, 10110110b Sir dw „abcd” mov al, 10110110b
out 43h, al Move cx,4 out 43h, al
mov al, 11d Mov si,0 mov al, k (partea low)
out 42h, al Et:mov al,sir[si] out 42h, al
mov al, 27d Et1:in ah,efdh mov al, k (partea high)
out 42h, al And ah,01100000b out 42h, al
mov al, ah Jz et1 mov al, ah
out 42h, al Out 3fdh,al out 42h, al
IN AL, 61h Inc si IN AL, 61h
OR AL, 00000011 Loop et OR AL, 00000011b
Out 61, Alh Out 61h, AL
Receptie astept: mov ah, 00h
Sir 2 db 4dup(o) int 16h
9. Interfata 8255: Sa se scrie un program in LA care configureaza 8255 ai Mov si,0h cmp al, 1bh
300h e adresa de baza: Mov cx,4 jne astept
PA – mod 0, in, PB – mod 0, in, PC – mod 0, out Et:in al,3fdh
PA, PC4 – PC7 – grup A; PB, PC3 – PC6 – grup B. And al,00000001b 8. Port paralel: Se cere un program care seteaza D0-D3=1, D4-D7=0. Esc
mov dx, 303h Jz et2 mov al, 00001111
mov al, 10010010 In ah,3fdh out 387h, al
out dx, al Mov sir2[si],ah astept: mov ah, 00h
mov dx, 300h Incs si int 16h
in al, dx Loop et2 cmp al, 1bh
mov dx, 301h jne astept
out dx, al mov al, 11110000
out 378h, al

S-ar putea să vă placă și