We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,601 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Little Endian Reverse

Hi guys I got a question about how to reversethe little endian. My questions is how do I do it. Say the user inputs hex 4423, how do I get it to reverse in the program to read as 2344? and help would be greatly appreciated. I need this because I'm doing a FAT16 decode program to display the date.

2
Contributors
2
Replies
23 Hours
Discussion Span
5 Months Ago
Last Updated
4
Views
Sasquadge
Light Poster
44 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 3

Assume AX = 4423H

1: Move AX -> CX
2: Shift AH -> AL
3: Shift CL -> CH
4: Move CH -> AH

BSWAP assuming your using Intel converts edian values, but what you require isn't exactly an edian conversion.

ShiftLeft
Light Poster
31 posts since Jun 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

I figured it out I just needed to do

ror ax, 8

Sasquadge
Light Poster
44 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 3

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0660 seconds using 2.71MB