Hi, If someone can help me... I have an Edit Control and I write a number into. (format decimal ex:255d). I get the info with GetWindowText --> buffer , But it is at the decimal format how can I convert it on hex format? Text(255) --> al(FFh) (al or other bl... or eax...) Thanks
Posted on 2000-11-23 16:22:00 by Morgatte
take a look to this it was for dos but conversion is the same ! Ciao AnGeLo WriteDigit: push dx ; xor dx,dx ; pop dx ; add dl,48 ; mov ah,2 ; int 21h ; execution ret ; ; **** routine WriteHexDigit: 4 bit conversion WriteHexDigit: push dx ; salva dx nello stack push dx ; inc CursCol ; mov dh,CursRow ; mov dl,CursCol ; call SetPosCurs ; pop dx ; cmp dl,10 ; Questo semibyte e' <10? jae HexLetter ; add dl,"0" ; change in number jmp WriteDig ; HexLetter: add dl,"A"-10 ; change in letter WriteDig: mov al,dl ; mov cx,1 ; mov Color,14 ; color for ex call PrintChAtt ; pop dx ; ret ;
Posted on 2000-11-24 02:04:00 by AnGeLo
use the masm32 library and the atodw function. You have to make sure that the text only contains numerical charaters otherwise it will corupt the result. See the masm32lib.hlp file which comes with masm32 for more help
Posted on 2000-11-24 02:39:00 by limit