Problème interruption asm

- - Dernière réponse :  Jhosua - 31 mars 2016 à 09:32
Bonjour,
j'ai un projet sur la programmation d'un jeu de brique en assembleur, mon problème c'est surtout sur l'utilisation des interruptions, l'interface avec l'interruption pour passer en mode graphique est sans souci, mais comment utiliser les interruptions clavier pour déplacer la raquette?
(j'ai utilisé tasm)

merci beaucoup pour votre aide
voici mon code:
.model small
.stack 200h
.data

.code

debut:
mov ax,@data
mov ds,ax
;Accès mode graphique
mov ax,13h
int 10H
;Entrer mémoire vidéo
mov ax, 0A000H
mov ds,ax
mov di,00
mov cx,0FA00h ;pixel 320*200 (64000(0FA00h))
mov al,00 ;couler

ici:
mov [di],al
inc di
loop ici
;--------------------------------
mov bx,175
to:
mov ax,320
mul bx
mov dx,135
add ax,dx
mov di,ax
mov cx,3
mov al,15
el:
mov [di],al
inc di
loop el
inc bx;
cmp bx,177
jbe to

mov bx,15
mov ax,320
mul bx
mov dx,70
add ax,dx
mov di,ax
mov cx,15
mov al,01
la1:
mov [di],al
inc di
loop la1
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,70
add ax,dx
mov di,ax
mov cx,15
mov al,01
lb1:
mov [di],al
inc di
loop lb1
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,90
add ax,dx
mov di,ax
mov cx,15
mov al,02
la2:
mov [di],al
inc di
loop la2
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,90
add ax,dx
mov di,ax
mov cx,15
mov al,02
lb2:
mov [di],al
inc di
loop lb2
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,03
la3:
mov [di],al
inc di
loop la3
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb3:
mov [di],al
inc di
loop lb3
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,04
la4:
mov [di],al
inc di
loop la4
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb4:
mov [di],al
inc di
loop lb4
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,05
la5:
mov [di],al
inc di
loop la5
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb5:
mov [di],al
inc di
loop lb5
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,06
la6:
mov [di],al
inc di
loop la6
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb6:
mov [di],al
inc di
loop lb6
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,07
la7:
mov [di],al
inc di
loop la7
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,07
lb7:
mov [di],al
inc di
loop lb7
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,210
add ax,dx
mov di,ax
mov cx,15
mov al,08
la8:
mov [di],al
inc di
loop la8
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,210
add ax,dx
mov di,ax
mov cx,15
mov al,08
lb8:
mov [di],al
inc di
loop lb8
;---------------------------------
;---------------------------------
mov bx,15
mov ax,320
mul bx
mov dx,230
add ax,dx
mov di,ax
mov cx,15
mov al,09
la9:
mov [di],al
inc di
loop la9
;---------------------------------
;---------------------------------
mov bx,16
mov ax,320
mul bx
mov dx,230
add ax,dx
mov di,ax
mov cx,15
mov al,09
lb9:
mov [di],al
inc di
loop lb9
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,80
add ax,dx
mov di,ax
mov cx,15
mov al,01
la11:
mov [di],al
inc di
loop la11
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,80
add ax,dx
mov di,ax
mov cx,15
mov al,01
lb11:
mov [di],al
inc di
loop lb11
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,100
add ax,dx
mov di,ax
mov cx,15
mov al,02
la12:
mov [di],al
inc di
loop la12
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,100
add ax,dx
mov di,ax
mov cx,15
mov al,02
lb12:
mov [di],al
inc di
loop lb12
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
la13:
mov [di],al
inc di
loop la13
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb13:
mov [di],al
inc di
loop lb13
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
la14:
mov [di],al
inc di
loop la14
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb14:
mov [di],al
inc di
loop lb14
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
la15:
mov [di],al
inc di
loop la15
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb15:
mov [di],al
inc di
loop lb15
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
la16:
mov [di],al
inc di
loop la16
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb16:
mov [di],al
inc di
loop lb16
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,200
add ax,dx
mov di,ax
mov cx,15
mov al,07
la17:
mov [di],al
inc di
loop la17
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,200
add ax,dx
mov di,ax
mov cx,15
mov al,07
lb17:
mov [di],al
inc di
loop lb17
;---------------------------------
;---------------------------------
mov bx,19
mov ax,320
mul bx
mov dx,220
add ax,dx
mov di,ax
mov cx,15
mov al,08
la18:
mov [di],al
inc di
loop la18
;---------------------------------
;---------------------------------
mov bx,20
mov ax,320
mul bx
mov dx,220
add ax,dx
mov di,ax
mov cx,15
mov al,08
lb18:
mov [di],al
inc di
loop lb18
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,90
add ax,dx
mov di,ax
mov cx,15
mov al,01
la21:
mov [di],al
inc di
loop la21
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,90
add ax,dx
mov di,ax
mov cx,15
mov al,01
lb21:
mov [di],al
inc di
loop lb21
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,02
la22:
mov [di],al
inc di
loop la22
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,02
lb22:
mov [di],al
inc di
loop lb22
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,03
la23:
mov [di],al
inc di
loop la23
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb23:
mov [di],al
inc di
loop lb23
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,04
la24:
mov [di],al
inc di
loop la24
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb24:
mov [di],al
inc di
loop lb24
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,05
la25:
mov [di],al
inc di
loop la25
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb25:
mov [di],al
inc di
loop lb25
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,06
la26:
mov [di],al
inc di
loop la26
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb26:
mov [di],al
inc di
loop lb26
;---------------------------------
;---------------------------------
mov bx,23
mov ax,320
mul bx
mov dx,210
add ax,dx
mov di,ax
mov cx,15
mov al,07
la27:
mov [di],al
inc di
loop la27
;---------------------------------
;---------------------------------
mov bx,24
mov ax,320
mul bx
mov dx,210
add ax,dx
mov di,ax
mov cx,15
mov al,07
lb27:
mov [di],al
inc di
loop lb27
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,100
add ax,dx
mov di,ax
mov cx,15
mov al,02
la31:
mov [di],al
inc di
loop la31
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,100
add ax,dx
mov di,ax
mov cx,15
mov al,02
lb31:
mov [di],al
inc di
loop lb31
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
la32:
mov [di],al
inc di
loop la32
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb32:
mov [di],al
inc di
loop lb32
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
la33:
mov [di],al
inc di
loop la33
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb33:
mov [di],al
inc di
loop lb33
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
la34:
mov [di],al
inc di
loop la34
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb34:
mov [di],al
inc di
loop lb34
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
la35:
mov [di],al
inc di
loop la35
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb35:
mov [di],al
inc di
loop lb35
;---------------------------------
;---------------------------------
mov bx,27
mov ax,320
mul bx
mov dx,200
add ax,dx
mov di,ax
mov cx,15
mov al,07
la36:
mov [di],al
inc di
loop la36
;---------------------------------
;---------------------------------
mov bx,28
mov ax,320
mul bx
mov dx,200
add ax,dx
mov di,ax
mov cx,15
mov al,07
lb36:
mov [di],al
inc di
loop lb36
;---------------------------------
;---------------------------------
mov bx,31
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,03
la41:
mov [di],al
inc di
loop la41
;---------------------------------
;---------------------------------
mov bx,32
mov ax,320
mul bx
mov dx,110
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb41:
mov [di],al
inc di
loop lb41
;---------------------------------
;---------------------------------
mov bx,31
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,04
la42:
mov [di],al
inc di
loop la42
;---------------------------------
;---------------------------------
mov bx,32
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb42:
mov [di],al
inc di
loop lb42
;---------------------------------
;---------------------------------
mov bx,31
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,05
la43:
mov [di],al
inc di
loop la43
;---------------------------------
;---------------------------------
mov bx,32
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb43:
mov [di],al
inc di
loop lb43
;---------------------------------
;---------------------------------
mov bx,31
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,06
la44:
mov [di],al
inc di
loop la44
;---------------------------------
;---------------------------------
mov bx,32
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb44:
mov [di],al
inc di
loop lb44
;---------------------------------
;---------------------------------
mov bx,31
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,07
la45:
mov [di],al
inc di
loop la45
;---------------------------------
;---------------------------------
mov bx,32
mov ax,320
mul bx
mov dx,190
add ax,dx
mov di,ax
mov cx,15
mov al,07
lb45:
mov [di],al
inc di
loop lb45
;---------------------------------
;---------------------------------
mov bx,35
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
la51:
mov [di],al
inc di
loop la51
;---------------------------------
;---------------------------------
mov bx,36
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb51:
mov [di],al
inc di
loop lb51
;---------------------------------
;---------------------------------
mov bx,35
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
la52:
mov [di],al
inc di
loop la52
;---------------------------------
;---------------------------------
mov bx,36
mov ax,320
mul bx
mov dx,140
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb52:
mov [di],al
inc di
loop lb52
;---------------------------------
;---------------------------------
mov bx,35
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
la53:
mov [di],al
inc di
loop la53
;---------------------------------
;---------------------------------
mov bx,36
mov ax,320
mul bx
mov dx,160
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb53:
mov [di],al
inc di
loop lb53
;---------------------------------
;---------------------------------
mov bx,35
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
la54:
mov [di],al
inc di
loop la54
;---------------------------------
;---------------------------------
mov bx,36
mov ax,320
mul bx
mov dx,180
add ax,dx
mov di,ax
mov cx,15
mov al,06
lb54:
mov [di],al
inc di
loop lb54
;---------------------------------
;---------------------------------
mov bx,39
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,03
la61:
mov [di],al
inc di
loop la61
;---------------------------------
;---------------------------------
mov bx,40
mov ax,320
mul bx
mov dx,130
add ax,dx
mov di,ax
mov cx,15
mov al,03
lb61:
mov [di],al
inc di
loop lb61
;---------------------------------
;---------------------------------
mov bx,39
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,04
la62:
mov [di],al
inc di
loop la62
;---------------------------------
;---------------------------------
mov bx,40
mov ax,320
mul bx
mov dx,150
add ax,dx
mov di,ax
mov cx,15
mov al,04
lb62:
mov [di],al
inc di
loop lb62
;---------------------------------
;---------------------------------
mov bx,39
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,05
la63:
mov [di],al
inc di
loop la63
;---------------------------------
;---------------------------------
mov bx,40
mov ax,320
mul bx
mov dx,170
add ax,dx
mov di,ax
mov cx,15
mov al,05
lb63:
mov [di],al
inc di
loop lb63
;---------------------------------
;--------------------------------
mov bx,179
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,30
mov al,10
la:
mov [di],al
inc di
loop la
;---------------------------------
;--------------------------------
mov bx,180
mov ax,320
mul bx
mov dx,120
add ax,dx
mov di,ax
mov cx,30
mov al,10
lb:
mov [di],al
inc di
loop lb
;---------------------------------

mov ah,00
int 16H

mov ax,03
int 10h

mov ah,4Ch
int 21h
end
Afficher la suite 

Votre réponse

2 réponses

Messages postés
552
Date d'inscription
jeudi 28 novembre 2002
Dernière intervention
26 mars 2016
0
Merci
J'ai un vague souvenir de l'interruption clavier, ça devrait suffire pour un exercice scolaire.
Il faut Retrouver son numéro et surtout, si rien n'a changer, le tampon dans lequel elle dépose le code de la touche.
Le tampon doit être circulaire, c'est a dire qu'il recommence au début lorsqu'il est plein.
le code des touches peut être en deux ou trois octets, retrouver le nom du codage.
Il faut venir scruter ce tampon, voir de temps en temps quel est le nombre de touches tapées et agir en conséquence.


--
Commenter la réponse de ToutEnMasm
Messages postés
552
Date d'inscription
jeudi 28 novembre 2002
Dernière intervention
26 mars 2016
0
Merci
Il y a aussi une recherche dans ce forum
http://codes-sources.commentcamarche.net/forum/asm-112/solved


--
merci beaucoup pour votre réponse!
Commenter la réponse de ToutEnMasm

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.