• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Help Me Assembly Coding Gods!

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
When we convert from a number to string, we do it from right to left. For example: 1384 is coverted as 4831. Obviously, we need it done from left to right. So we use a stack. So in the example above, we push 4, 8, 3, 1. But when we pop, we get back 1, 3, 8, 4. So we get what we wanted - 1384.

As far as the "byte ptr", we're just indicating that we want to operate on a BYTE (so the byte ptr). It may be un-neccessary; it's just my style. In the same way, there's also WORD PTR, etc.
 
Also, remember that the code I gave doesn't deal with negative numbers. So IF you need to deal with them, you need to add a bit of code.
 
Back
Top