Hi, I'm new to masm32 and I'm trying to develop a program where at one point I have to turn a number I receive from the user into decimal, the user also tells me in what base the number he entered is in, its pretty simple. What I had in mind was to get the number received from the user and save it in an array digit by digit so I can then operate each digit, the problem I'm having is I'm not quite sure how to do that in masm32, any help or tips would be greatly appreciated.
what base will he use to enter the base ??? :badgrin:
anyways, there are a couple MSVCRT functions that may help, _i64toa and _strtoui64
i have never used that last one :P
http://msdn.microsoft.com/en-US/library/yakksftt%28v=vs.80%29.aspx (http://msdn.microsoft.com/en-US/library/yakksftt%28v=vs.80%29.aspx)
http://msdn.microsoft.com/en-us/library/85zk715d%28v=vs.80%29.aspx (http://msdn.microsoft.com/en-us/library/85zk715d%28v=vs.80%29.aspx)
here is some discussion...
http://www.autohotkey.com/board/topic/18670-converting-numbers-to-any-base-radix-using-msvcrtdll/ (http://www.autohotkey.com/board/topic/18670-converting-numbers-to-any-base-radix-using-msvcrtdll/)
if you want to roll your own, you could use Ling Long Kai Fang (Horner's Rule) :P
http://masm32.com/board/index.php?topic=1932.msg20259#msg20259 (http://masm32.com/board/index.php?topic=1932.msg20259#msg20259)
Ok thanks, Ill check that out
Hi sabernal,
Quote from: sabernal on June 04, 2013, 08:25:41 AM
Ok thanks, Ill check that out
yes of course and welcome to the forum.
Gunther