The MASM Forum

General => The Campus => Topic started by: rodolfolopes on October 16, 2014, 05:31:16 PM

Title: Is this possible in MASM32 ?
Post by: rodolfolopes on October 16, 2014, 05:31:16 PM
HI there guys AGAIN!
I know i have been asking a lot of help from you, but im really new to this.

I have been reading documentation contained in the MASM32 editor but I couldnt find anything, but, here's my question:

Is there a way to convert a number to the equal value in HEXADECIMAL and OCTAL value?

For example:
Number: 10
The result:
Hexadecimal: A
Oct: 12



I dont know if its possble, BUt if it's i would appreciate a lot the help.

Thanks a lot guys ^_^

Title: Re: Is this possible in MASM32 ?
Post by: MichaelW on October 16, 2014, 06:17:00 PM
There is a CRT function that can convert an integer to a string, using any base from 2 to 36, see  _itoa... (http://msdn.microsoft.com/en-us/library/yakksftt.aspx), and you can readily call (invoke) the function using the name crt__itoa.
Title: Re: Is this possible in MASM32 ?
Post by: dedndave on October 16, 2014, 06:21:04 PM
we rarley use octal - lol
but there are also macros to handle these conversions

look in the file: \masm32\help\hlhelp.chm

print hex$(eax)
print str$(eax)