PDA

View Full Version : Converting Hexa to Binary in Assembly8086


wayn3san
06-28-2010, 07:50 AM
hi guys,

i need help to create a program on how to convert hexadecimal to binary in assembly language . im using winasm as my compiler and i have no idea how to do it!


this is my logic,
first i have to get user input
then convert it to ascii?
then convert to binary?

if im not wrong.

shed osme light please

oracleguy
06-28-2010, 04:33 PM
The user input will already be in ASCII. Get your program to the point where it asks the user for input and reads what they type. Then you'll want to convert the ASCII characters to their actual numerical equivalents. e.g. if they type in 'F3' that would be read as 0x4633 and you need to convert it to 0xF3.

Then printing out the binary representation of the number is pretty easy.