1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
| .model small
.stack 500h
.486
;=======================================================
;Declaration des macros
;=======================================================
.data
;-------------------------------------------------------------------
;Tableaux
;-------------------------------------------------------------------
sprite DB 16, 27
DB 000,000,000,000,014,014,014,014,014,014,014,014,000,000,000,000
DB 000,000,000,032,032,032,014,014,014,014,032,032,032,000,000,000
DB 000,000,000,000,000,000,000,014,014,000,000,000,000,000,000,000
DB 000,000,000,000,000,000,032,014,014,032,000,000,000,000,000,000
DB 000,018,018,018,000,032,032,014,014,032,032,000,018,018,018,000
DB 000,018,018,018,000,032,032,014,014,032,032,000,018,018,018,000
DB 000,018,018,018,014,032,032,014,014,032,032,014,018,018,018,000
DB 000,018,018,018,000,032,032,014,014,032,032,000,018,018,018,000
DB 000,018,018,018,000,032,032,014,014,032,032,000,018,018,018,000
DB 000,000,000,000,000,032,032,018,018,032,032,000,000,000,000,000
DB 000,000,000,000,032,032,018,032,032,018,032,032,000,000,000,000
DB 000,000,000,000,032,018,032,032,032,032,018,032,000,000,000,000
DB 000,000,000,032,032,018,032,032,032,032,018,032,032,000,000,000
DB 000,000,000,032,032,018,032,032,032,032,018,032,032,000,000,000
DB 000,000,000,032,032,018,032,032,032,032,018,032,032,000,000,000
DB 000,000,000,032,032,018,032,032,032,032,018,032,032,000,000,000
DB 000,000,000,000,032,032,018,018,018,018,032,032,000,000,000,000
DB 000,000,000,000,032,032,032,014,014,032,032,032,000,000,000,000
DB 000,000,000,000,032,032,032,014,014,032,032,032,000,000,000,000
DB 018,018,018,000,032,032,032,014,014,032,032,032,000,018,018,018
DB 018,018,018,000,032,032,032,014,014,032,032,032,000,018,018,018
DB 018,018,018,014,032,032,032,014,014,032,032,032,014,018,018,018
DB 018,018,018,000,032,032,032,014,014,032,032,032,000,018,018,018
DB 018,018,018,000,032,032,014,014,014,014,032,032,000,018,018,018
DB 000,000,000,000,000,000,000,032,032,000,000,000,000,000,000,000
DB 000,014,014,014,014,014,014,014,014,014,014,014,014,014,014,000
DB 014,032,032,032,032,032,032,032,032,032,032,032,032,032,032,014
.code
;--------------------------------------------------------
;debut du pgm -
;--------------------------------------------------------
main proc
MOV AX,@data
MOV DS,AX
;---------------------------------------------------------
; Corps du programme -
;---------------------------------------------------------
;-----------------------------------------
mov ah,0
mov al,12h
int 10h
mov cx,27
mov bx,16
mov bp,0
mov di,0
mov si,offset sprite
call mon_draw_sprite
CALL arret
;--------------------------------------------------------
; fin du programme -
;--------------------------------------------------------
MOV AX,04c00h
INT 21h
main ENDP
;==========================================================
; Procedures -
;==========================================================
;-----------------------------------------
; arret - attente d'une touche
;
; Auteur :Julien Azria
; Description :attente d'une touche
; provoque l'arret
; Use :arret 16(service 0h)
;-----------------------------------------
arret PROC
MOV AH,00h
INT 16h
RET
arret ENDP
;--------------------------------------------------------
mon_draw_sprite proc
;arguments : offset sprite --> si
; hauteur sprite --> cx
; largeur sprite --> bx
; pos_x --> bp
; pos_y --> di
;on donne à :hola: di les bonnes coordonnées pour l'affichage
push ax di bp si cx bx
mov ax,320
mul di
add ax,bp
mov di,ax
add si,2
boucle1 :
push cx
push di
xor cx,cx
mov cl,bl
boucle2 :
mov al,[si]
mov es:[di],al
inc si
inc di
loop boucle2
pop di
pop cx
add di,320
loop boucle1
; on restaure ce qui a été sauvegardé
pop bx cx si bp di ax
ret
mon_draw_sprite endp
;-----------------------------------------------
end main |
Partager