- .model tiny
- .stack
- .code
- org 200h
-
- saisie db "[a] afficher menu [b] Afficher le menub [q] quitter?$"
- bon db "ok sa marche",13,10,'$'
- saisie2 db "[r] Retour au menu?$"
- sort db "bye bye!",13,10,'$'
-
- bon2 db "Le deuxieme menu marche",13,10,'$'
-
- start:
-
- ;initialisation du PSP
- mov ax,@data
- mov ds,ax
-
- ;efface ecran
- mov ax,0013h
- int 10h
- mov ax,003h
- int 10h
-
- ;appel du texte de saisie
- mov dx,offset saisie
- mov ah,09h
- int 21h
-
- ; la ligne mov ah,01h est indispensable pour chaque saisie de touche
- ; sinon rien ne fonctionne
-
- mov ah,01h
- int 21h
-
- cmp al,'a' ; si la touche minuscule a est appuyee alors on affiche
- je menu ; le menu:
-
- cmp al,'b'
- je menu2
-
- cmp al,'q' ; si la touche q minuscule est appuyee alors on affiche
- je sortie ; le menu de sortie
-
- menu:
- mov ax,0013h ;appel du mode texte
- int 10h ;mode video
- mov ax,0003h ;efface l'ecran
- int 10h ;mode video
-
- mov dx,offset bon ;appel du texte bon
- mov ah,09h ;procedure d'affichage
- int 21h ;du mode msdos
-
- mov dx,offset saisie2 ;appelle de la saisie2
- mov ah,09h ;affiche le message
- int 21h ;sous msdos
-
- mov ah,01h ;appel du mode saisie,sans ca rien ne
- int 21h ;fonctionne
-
- cmp al,'r' ;si la touche r minuscule est appuyee alors
- je start ;on retourne au menu principale
-
-
- menu2:
-
- mov ax,0013h ;appel du mode texte
- int 10h ;mode video
- mov ax,0003h ;efface l'ecran
- int 10h ;mode video
-
- mov dx,offset bon2 ;appel du texte bon
- mov ah,09h ;procedure d'affichage
- int 21h ;du mode msdos
-
- mov dx,offset saisie2 ;appelle de la saisie2
- mov ah,09h ;affiche le message
- int 21h ;sous msdos
-
- mov ah,01h ;appel du mode saisie,sans ca rien ne
- int 21h ;fonctionne
-
- cmp al,'r' ;si la touche r minuscule est appuyee alors
- je start ;on retourne au menu principale
-
-
-
- sortie:
-
- mov ax,0013h ;procedure de sortie en effacant l'ecran
- int 10h ;en mode texte avec l'int 10h
- mov ax,0003h
- int 10h
-
- mov dx,offset sort ;procedure habituel d'affichage de texte
- mov ah,09h
- int 21h
-
- mov al,00h ;reinitialise le clavier avant la sortie
- mov ax,4c00h ;retourne sous le promt (win95)
- int 21h ;shell msdos
- end start
-
-
- ;tasm /o menu.asm
- ;tlink menu.obj
-
-
.model tiny
.stack
.code
org 200h
saisie db "[a] afficher menu [b] Afficher le menub [q] quitter?$"
bon db "ok sa marche",13,10,'$'
saisie2 db "[r] Retour au menu?$"
sort db "bye bye!",13,10,'$'
bon2 db "Le deuxieme menu marche",13,10,'$'
start:
;initialisation du PSP
mov ax,@data
mov ds,ax
;efface ecran
mov ax,0013h
int 10h
mov ax,003h
int 10h
;appel du texte de saisie
mov dx,offset saisie
mov ah,09h
int 21h
; la ligne mov ah,01h est indispensable pour chaque saisie de touche
; sinon rien ne fonctionne
mov ah,01h
int 21h
cmp al,'a' ; si la touche minuscule a est appuyee alors on affiche
je menu ; le menu:
cmp al,'b'
je menu2
cmp al,'q' ; si la touche q minuscule est appuyee alors on affiche
je sortie ; le menu de sortie
menu:
mov ax,0013h ;appel du mode texte
int 10h ;mode video
mov ax,0003h ;efface l'ecran
int 10h ;mode video
mov dx,offset bon ;appel du texte bon
mov ah,09h ;procedure d'affichage
int 21h ;du mode msdos
mov dx,offset saisie2 ;appelle de la saisie2
mov ah,09h ;affiche le message
int 21h ;sous msdos
mov ah,01h ;appel du mode saisie,sans ca rien ne
int 21h ;fonctionne
cmp al,'r' ;si la touche r minuscule est appuyee alors
je start ;on retourne au menu principale
menu2:
mov ax,0013h ;appel du mode texte
int 10h ;mode video
mov ax,0003h ;efface l'ecran
int 10h ;mode video
mov dx,offset bon2 ;appel du texte bon
mov ah,09h ;procedure d'affichage
int 21h ;du mode msdos
mov dx,offset saisie2 ;appelle de la saisie2
mov ah,09h ;affiche le message
int 21h ;sous msdos
mov ah,01h ;appel du mode saisie,sans ca rien ne
int 21h ;fonctionne
cmp al,'r' ;si la touche r minuscule est appuyee alors
je start ;on retourne au menu principale
sortie:
mov ax,0013h ;procedure de sortie en effacant l'ecran
int 10h ;en mode texte avec l'int 10h
mov ax,0003h
int 10h
mov dx,offset sort ;procedure habituel d'affichage de texte
mov ah,09h
int 21h
mov al,00h ;reinitialise le clavier avant la sortie
mov ax,4c00h ;retourne sous le promt (win95)
int 21h ;shell msdos
end start
;tasm /o menu.asm
;tlink menu.obj