Table de multiplication

Fermé
danikis Messages postés 2 Date d'inscription lundi 4 juillet 2016 Statut Membre Dernière intervention 5 juillet 2016 - Modifié par jordane45 le 5/07/2016 à 23:35
fiddy Messages postés 11069 Date d'inscription samedi 5 mai 2007 Statut Contributeur Dernière intervention 23 avril 2022 - 5 juil. 2016 à 23:05
Bonjour, voici mon programme en assembleur mais ça ne marche pas comme je le souhaite:
DOSSEG
.MODEL small
.STACK 100h
.DATA 
Msg3 DB  '      table de multiplication par 3',13,10,'$'
msg1 DB ' taper un entier  ',13,10,'$'
msg2 DB ' taper un entier  ',13,10,'$'
msgb3 DB '3*2=6',13,10,'$'
msgb4 DB '3*3=9',13,10,'$'
msgb5 DB '3*4=12',13,10,'$'
msgb6 DB '3*5=15',13,10,'$'
msgb7 DB '3*6=18',13,10,'$'
msgb8 DB '3*7=21',13,10,'$'
msgb9 DB '3*8=24',13,10,'$'
msgb10 DB '3*9=27',13,10,'$'
msgb11 DB '3*10=30',13,10,'$'
b db 2

 .code

  mov ax,@data
  mov ds,ax

  

  lea dx,msg2
  mov dx,01H
  mov cx,2
  cmp dx,01H
  ja fin
  int 21H
 

   sub al,30H
   cmp al,09H
   JBE L3
   sub al,07H
 L3: mov cl,04H
     ROL al,cl
     mov bh,al

     mov ah,01H
     int 21H

     sub al,30H
     cmp al,09H
     JBE L4
     sub al,07H
  L4:ADD bh,al

     ADD bl,bh 

    lea dx,msg3
    mov ah,09H
mov dx,OFFSET Msgb3
int 21h
mov ah,9
mov dx,OFFSET Msgb4
int 21h
mov ah,9
mov dx,OFFSET Msgb5
int 21h
mov ah,9
mov dx,OFFSET Msgb6
int 21h
mov ah,9

mov dx,OFFSET Msgb7
int 21h
mov ah,9
mov dx,OFFSET Msgb8
int 21h
mov ah,9
mov dx,OFFSET Msgb9
int 21h
mov ah,9
mov dx,OFFSET Msgb10
int 21h
mov ah,9
mov dx,OFFSET Msgb11
int 21h
mov ah,9
    
 mov ah,4ch
 int 21H
fin : mov ah,9
mov dx,OFFSET Msgb6
int 21h
    end


EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ici :ICI

Merci d'y penser dans tes prochains messages.


1 réponse

fiddy Messages postés 11069 Date d'inscription samedi 5 mai 2007 Statut Contributeur Dernière intervention 23 avril 2022 1 835
5 juil. 2016 à 23:05
Ce n'est pas du C...
Je redirige ton post dans la bonne catégorie.

La prochaine fois, pense aussi à utiliser les balises pour faciliter la lecture.
Par exemple :
<code asm>ici tu mets ton code</code>
0