i am a beginner of assembly language programming particularly on that with TASM.. We are asked to code a program wherein the user will asked to input a character or a word and then it will print the number of characters inputted by the user.. counting number of characters includes the space(s). here's my code. Kindly help me with this matter.. i really dont know how to fix it..

.MODEL SMALL
.STACK 100h
.DATA

CharPrompt DB 'Enter a word or character: $'
DisplayNumChar DB 13,10,'Number of character is.',13,10, '$'


.CODE
start:
mov ax,@data
mov ds,ax
mov dx,OFFSET CharPrompt
mov ah,9
int 21h
mov ah,10
int 21h


mov ax,@data
mov ds,ax
mov dx,OFFSET DisplayNumChar
mov ah,9
int 21h





mov ah,4ch
mov al,0
int 21h

END start

thank you for the big help.. i need it now badly.. thanks..

Hi first of all to read the character or word from keyboard u should have a buffer declared at the beginning itself .... then try to get the count of characters from the buffer...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.