Skip to content

Instantly share code, notes, and snippets.

@jy95
Created November 14, 2014 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jy95/af646c79a99fd90879ac to your computer and use it in GitHub Desktop.
Save jy95/af646c79a99fd90879ac to your computer and use it in GitHub Desktop.
DOSSEG
.MODEL SMALL
.STACK 100h
.DATA
mes DB 'VEUILLEZ ENTRER UN MESSAGE DE MAX 254 CARACTERES' , '$'
buf DB 255,?, 255 (?)
.CODE
deb:
mov ax,@data
mov ds,ax
;affiche le message (+ un petit passage a la ligne)
mov dx,OFFSET mes
mov ah,09h
int 21h
mov ah,02h
mov dl,10
int 21h
; stockage du message user avec le !
mov bx,OFFSET buf
ADD bx,2 ; pour ne pas afficher 255 et nombre de caracteres (probleme n°1)
mov AH,0Ah
int 21h
mov si,[bx+1]
mov byte ptr [bx+si+2] , '$' ; mettre le $ à la fin pour arreter l'encodage (probleme n°2)
; passe une ligne à l'écran
mov ah,02h
mov dl,10
int 21h
; affiche le message user + !
mov bx,OFFSET buf
mov ah,09h
int 21h
mov ah,02h
mov dl,10
int 21h
; fin du prog
fin: mov AH,4ch
int 21h
END deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment