how can i convert decimal to hex using assembly language x86 masm

6.7k views Asked by At

1) Convert a decimal number to hex.

I dont know how to convert decimal to hex. I just input a number but i have no clue how to start next. Any help is appreciated.

TITLE   
include irvine32.inc
.data
a dword ?
b dword ?
final dword ?
count dword 0
prompt1 byte ,'Enter a number',0
.code
main PROC
    mov edx,offset prompt1
    call writestring
    call readint
    mov a,eax
main ENDP

END main
1

There are 1 answers

4
major4x On BEST ANSWER

Probably what they want from you is to write a loop that divides by 16 and gets the remainder of division by 16. It is not very clear, however, what you're asking. What is "prompt1"?