The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Vineel Kumar Reddy Kovvuri on April 17, 2007, 08:22:59 PM

Title: input output operations from command prompt in MASM32 please help me....
Post by: Vineel Kumar Reddy Kovvuri on April 17, 2007, 08:22:59 PM

hi everybody

i am newbie to assembly


please suggest me a way to perform command prompt I/O operations in MASM32
like some thing similar to printf,scanf function



thanks in advance
Title: Re: input output operations from command prompt in MASM32 please help me....
Post by: hutch-- on April 17, 2007, 10:44:08 PM
Have a look at the example code for console applications. In particular the "input" and "print" macro support. These are useful to get you going then you can directly use the Windows API functions to do this stuff yourself.
Title: Re: input output operations from command prompt in MASM32 please help me....
Post by: dsouza123 on April 17, 2007, 10:46:43 PM
Using some high level macros and procedures that are similar to basic commands
along with some individual x86 assembly instructions.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
   include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

comment * -----------------------------------------------------
                       Build this  template with
                      "CONSOLE ASSEMBLE AND LINK"
       ----------------------------------------------------- *
   .data
      var dd 89

   .code

start:
 
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

   call main
   inkey
   exit

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

main proc
   
   mov eax, var
   print str$(eax)," is the original number",13,10

   mov edx, 10
   add var, edx
   print str$(edx)," is added to it",13,10

   mov eax, var
   print str$(eax)," is the final number.",13,10,13,10

   ret

main endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start

[attachment deleted by admin]
Title: Re: input output operations from command prompt in MASM32 please help me....
Post by: Vineel Kumar Reddy Kovvuri on April 18, 2007, 08:24:16 PM


thank you very much sir
you guys helped me alot .