- .Data
-
- .code
- mov ax, 13h ; Passe en mode graphique VGA 320x200x256
- int 10h
-
- mov bx,00h ; x
- mov dx,00h ; couleur
- mov cx,00h ; y
-
- NextPix: call Pixel ; Dessinne 1 pixel
- inc dx ; Incremente couleur
- mov bx,dx ; Choisit un autre pixel
- mov cx,dx
- cmp bx,0FFh ; Si bx <> 320 on dessine le pix suivant
- jne Nextpix
-
-
- KeyQuit: mov ah,1 ; attand l'appuye d'une touche
- int 16h
- je KeyQuit
-
- mov ax,0003h ; Retour en mode texte 80x25x16
- int 10h
-
- mov ax,4C00h ; Bye!
- int 21h
-
-
- Pixel: ; ax = rien bx = x (m) cx = y (m) dl = couleur
- mov es,0a000h ; segment : carte video
- imul cx,0140h ; multiplie cx par 320
- add bx,cx ; cx est ajouté à la base
- mov es:[bx],dl ; Dessine le pixel décrit dans dl
- ret
.Data
.code
mov ax, 13h ; Passe en mode graphique VGA 320x200x256
int 10h
mov bx,00h ; x
mov dx,00h ; couleur
mov cx,00h ; y
NextPix: call Pixel ; Dessinne 1 pixel
inc dx ; Incremente couleur
mov bx,dx ; Choisit un autre pixel
mov cx,dx
cmp bx,0FFh ; Si bx <> 320 on dessine le pix suivant
jne Nextpix
KeyQuit: mov ah,1 ; attand l'appuye d'une touche
int 16h
je KeyQuit
mov ax,0003h ; Retour en mode texte 80x25x16
int 10h
mov ax,4C00h ; Bye!
int 21h
Pixel: ; ax = rien bx = x (m) cx = y (m) dl = couleur
mov es,0a000h ; segment : carte video
imul cx,0140h ; multiplie cx par 320
add bx,cx ; cx est ajouté à la base
mov es:[bx],dl ; Dessine le pixel décrit dans dl
ret