LECTURE ET ECRITURE D'UN CARACTERE ET D'UNE CHAINE DE CARACTERE !

zilot2 Messages postés 8 Date d'inscription samedi 25 octobre 2008 Statut Membre Dernière intervention 15 novembre 2009 - 27 juil. 2009 à 14:53
zilot2 Messages postés 8 Date d'inscription samedi 25 octobre 2008 Statut Membre Dernière intervention 15 novembre 2009 - 27 juil. 2009 à 14:53
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/49996-lecture-et-ecriture-d-un-caractere-et-d-une-chaine-de-caractere

zilot2 Messages postés 8 Date d'inscription samedi 25 octobre 2008 Statut Membre Dernière intervention 15 novembre 2009
27 juil. 2009 à 14:53
bonjours je suis debutant en asm et j'utilise emu8086 comme interface pour moi c la meilleur
votre probleme est la string take this note about 0ah fonction
INT 21h / AH=0Ah - input of a string to DS:DX, fist byte is buffer size, second byte is number of chars actually read. this function does not add '$' in the end of string. to print using INT 21h / AH=9 you must set dollar character at the end of it and start printing from address DS:DX + 2.

je crois que ca va resoudre votre probleme et voici un exemple :
org 100h
mov dx, offset buffer
mov ah, 0ah
int 21h
jmp print
buffer db 10,?, 10 dup(' ')
print:
xor bx, bx
mov bl, buffer[1]
mov buffer[bx+2], '$'
mov dx, offset buffer + 2
mov ah, 9
int 21h
ret
Rejoignez-nous