hello! all assembly coders

i m new to assembly language

and i want a program to input a string and then display it back to the user

Posted on 2009-08-25 09:13:59 by aloksaini

hello! all assembly coders

i m new to assembly language

and i want a program to input a string and then display it back to the user


You're just in luck. By utilizing the search mechanism here, along with your desire to learn assembly language, you should easily find what you need to achieve such a program :D
Posted on 2009-08-25 10:44:56 by SpooK
cant you help me

i searched everywhere

please help me
Posted on 2009-08-26 10:00:47 by aloksaini
Well are you looking to create a console window to get the input and send output or do you want to create a window and a text box and then display it back with messagebox api?  Your quest is quite generic right now.
Posted on 2009-08-26 20:28:08 by GoldStar611
no i want in put and output a string in dos mode

in tasm

please help me
Posted on 2009-08-27 04:14:41 by aloksaini
By dos mode, I assume you mean a black window with a command prompt, yes?
If its running on top of the operating system, we call it a Console.
Posted on 2009-08-27 04:44:33 by Homer
He probably means "true" DOS - segmentation, interrupts and all this stuff. Looks like a school homework to me.

aloksaini, what is your current progress in making this application? Many people here will gladly help you correct your errors but very few will write this application for you. And, besides, a homework like this has been done on this forum, like, hundreds of times. Use the search function, as suggested earlier, or clarify your problem. The more specific question - the more specific answer.
Posted on 2009-08-27 05:02:27 by ti_mo_n
i used search i cant find

my progress

is the one charachter function like this

mov ah,0h        ; function code
int 16h            ; calling function
mov char,al      ;move charachter in variable

please help me with a string input like
input for a full name e.g alok etc
Posted on 2009-08-27 06:45:53 by aloksaini
Just keep collecting characters until you see a 13.
When you see that, write a zero to the end of your string and return to the caller.
Posted on 2009-08-27 07:32:23 by Homer
what 13

can u give me a example please
Posted on 2009-08-27 10:34:15 by aloksaini

what 13

can u give me a example please

In simple terms, he's referring to the ASCII control code called "Carriage Return", in which is the code generated when you press the Enter/Return key.

ASCII Chart Reference
Posted on 2009-08-27 12:52:44 by SpooK
like this:

name db 128 dup(?)
mov ah,0h
int 16h
mov bl,odh
cmp bl,al
je done
mov name,al
loop loopc
mov ax,@data
mov ds,ax
mov ah,02h
mov dx,name
int 21h
mov ah,4c00h

please correct me

Posted on 2009-08-29 03:52:55 by aloksaini
You should make it a bit more readable. Place comments after the code and understand FULLY what each line does and why it needs to be done that way.  Get into good habbits now, or you won't make it later -- I promise you that.

I looked also at your int 21, 2 and it says print character, not print string i.e. you will only get one letter output

Take a look here at this post, there is a lot of good code on it

name db 128 dup(?)

mov ah,0h ;set ah to
int 16h ;get char from user -> stored into al

mov bl,odh
cmp bl,al ;compare entered char with 0D to see if he pressed enter
je done

mov name,al ;otherwise move char at al to name
;where do we update the pointer to name? if we don't update the pointer we will always
;overwrite our what was placed here earlier.  Is name even being used as a pointer?
; if so how big is it? byte word?

loop loopc ;get another char from user

mov ax,@data ; comment
mov ds,ax ; comment
mov ah,02h ; comment
mov dx,name ;
int 21h ;

mov ah,4c00h ;etc how can you move 2 bytes onto a 1 byte part of the register? maybe you mean AX
int21h ;etc[\code]
Posted on 2009-08-29 22:37:02 by GoldStar611
Any problems with DOS?
Download the Ralph-Brown-Interrupt-List here:
... and you will get all your answers.
I've done it too before I did any questions to the public.
Posted on 2009-08-31 16:32:53 by TasmDev