Search code examples
stringparsingintegermasm

How to convert string to integer in MASM


I want to simply get the user to input a number. I can get input (I think), but this is a string, and I need to convert it to a number (DWORD). I couldn't find anything that worked in MASM. I tried the C functions strtol and atoi, but it couldn't find them. Is there some function that works in MASM? Or do I have to write my own conversion?

I tried several include files, but I couldn't get the C functions:
windows.inc
kernel32.inc
user32.inc
msvcrt.inc


Solution

  • I did atoi PROTO C strptr:DWORD and then I was able to call atoi.