News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Adding, subtracting Hex values

Started by kesmezar, March 05, 2020, 10:23:58 PM

Previous topic - Next topic

kesmezar

Hello,
I am using RadAsm. How to add two hex values ​​entered in text boxes?
Thank you.

(invoke GetDlgitemText or GetDlgitemInt Or GetDlgitem) Which of these should I use?
and values dd or byte ?

sample; edit1: 11F794B7  edit2: 11F794B7

invoke GetDlgItemText,hWin,hexvaluetext1,offset value1   error?

jj2007

With GetDlgItemText, you only get a text representation of the number. You will have to convert it, either with your own algo, or with a predefined macro or C runtime routine etc. There are many ways to do that (example) - search the forum for convert number string

Vortex

Quote from: kesmezar on March 05, 2020, 10:23:58 PM
How to add two hex values ​​entered in text boxes?

Hello,

Reading \masm32\help\masmlib.chm :

Quotehtodw

htodw proc uses ebx ecx edi edx esi String:DWORD

Description

htodw receives as its parameter, the address of a zero terminated string containing hex characters and returns the value as a DWORD in eax.

Parameter

1. String The address of the zero terminated string to be converted.

Return Value

The DWORD value is returned in eax.

Comments

It is the users responsibility to ensure that there are no non-hexadecimal characters in the string of numbers.