How do i get user input in assembly? after getting the input, i'd like for the inputted value to be stored in a char array in c.
i'm new to assembly and i am having a hard time trying to figure this out.
i've tried a code like this and obviously it's wrong. lol

printf("Enter a 16 bit Hexadecimal number:");
__asm__ ("leal edx,%0;" 
	 "movl ah, 0ah;" 
	 "int 21h;"
	 : "=r" ( val )
	);

anyway, any help would be great. thanks!

you can't use interrupts in 32-bit protected-mode programs (e.g. windows or *nix programs). Easiest way is to call os C functions and let them deal with all the dirty stuff in protected mode. If you don't know how to do that there is another thread that will show you how to call ms-windows win32 api functions.

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.