Wednesday, 2 October 2013

Counting Memory

Counting Memory

So I defined a long such as:
memTotal: .long 0
Then, I am adding to it with something like this:
addl 12(%di), %ecx
Where I then move %ecx to memTotal. My question is, how would I go about
calculating the size in MB of the memTotal. I tried something along the
lines of:
shrl $20, %eax
But how would I then print that as in int for MB?
Am I on the right track? Any help is appreciated.

No comments:

Post a Comment