Archived

This topic is now archived and is closed to further replies.

Help with (Intel) assembly language, converting hex to binary and back...

This topic is 5016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to write a hex calculator where you input two hex numbers and then a operation (+, -, *, /). To do this I need to first convert the hex numbers to binary then do the calculation then convert back, yet I am stuck doing the conversions. I know how to do it on paper, but not in assembly language. Somehow I don''t see being able to just say if the hex is "a" then make "1010"

Share this post


Link to post
Share on other sites
Hm, I''m kind of confused, do you want to convert the string "a" into the string "1010"? Or do you want to convert the string "a" into something you can do arithmetic (easily) on?
Sounds mysteriously much like your average homework to me...

Share this post


Link to post
Share on other sites
If you don''t know assembly language well enough to figure out an approach for yourself, why not use a lookup table?

It''s the method I used until I got adventurous enough to do it ''properly'' in assembler.





Stevie

Don''t follow me, I''m lost.

Share this post


Link to post
Share on other sites