Shifting only works for powers of two. In any case, it is a substitute for what is actually happening: you are dividing by the radix.

So, to get the tens place from a decimal number, you must first divide by ten, then get the remainder of another division by ten. For example:

4321
4321 divide 10 --> 432
432 modulo 10 --> 2

To get the hundreds place, you divide by ten twice (which is the same as dividing by 100). Etc.

Typical integer to string conversion routines use exactly this algorithm to get each digit, repeating until the number is zero.

It will be the same no matter how many bytes you use, since base 10 doesn't directly map to base 2; that is, a base 10 digit may span from one byte to another.

>Shifting only works for powers of two.
By "shifting" I meant knocking off the least significant digit (division by 10, for example), not bitwise shifting specifically. Sorry for the confusion.

> By "shifting" I meant knocking off the least significant digit...
Yeah, I figured that's what you meant, but a total newbie would have confused it. Natural language is an enemy, alas. (I know it; I confuse people often enough when I try to make a short answer. And no one reads a long answer through...) :sweat: ;)

So im suppose to divide the al register by 10 to get 2 in it ? means i have to store it somewhere first so that i can div again to get the scond char? i shall try and post back later !

Each time you divide you loose the least-significant digit (the one in the ones position).

So if you want to get the tens position digit (2 in both our examples) you divide by 10 to move it to the ones position. Then use modulo 10 to extract the ones digit only.

This is pure math, so you'll have to think about it some. Good luck.

Good day community,
I have completed vb.net program (a school timetabling program) and I am in the process to create a website. At the moment word -press on wamp server ...

I am looking for log archival utility or approach which should be able to help me in based on below policy.
(1) whenever log file (system.log) size >30859 or file ...