×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

CONVERSION FROM BINARY TO HEXADECIMAL

CONVERSION FROM BINARY TO HEXADECIMAL

CONVERSION FROM BINARY TO HEXADECIMAL

(OP)
I'm writing an assembly code and try to work it in sim68k. I couldn't figure out how to convert from binary numbers to hexadecimal. anyone could help me?

RE: CONVERSION FROM BINARY TO HEXADECIMAL

each 4 bits (a nyble) makes up a digit of hexadecimal.
each byte (2 nybles) has 2 digits.

How I did it for speed was to have a string with value of '0123456789ABCDEF'

say al holds value I want to convert:

mov ebx,OFFSET HEXstring
or eax,0Fh
add ebx,eax
mov al,[ebx]

al will hold ascii charactor!

to do high digit aswel:

push ax
{do low charactor}
pop ax
shr al,4
{do low charactor but returns high char}

this should help you but i didnt have the time to go deep on this right now, if it doesnt help reply to this.

"People who have nothing to say, say it too loud and have little knowledge. It's the quiet ones you need to worry about!"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close