First you need to know how to perform multi-word addition and subtraction, as well as multi-word shifts.
This is done using the adc and sbb instructions. For shifts you must use rcl and rcr.
Basically, to add two 64-bit numbers:
.data
num1 dq 100
num2 dq 200
.code
mov ecx,dword ptr num1
add dword ptr num2,ecx
mov ecx,dword ptr num1[4]
ADC dword ptr num2[4],ecx
Subtraction is performed by replacing ADD with SUB and ADC with SBB.
For shift, you must shift by only one bit at a time.
To shift a 64-bit number left (i.e. x2)
shl dword ptr num1,1
rcl dword ptr num1[4],1
To shift a 64-bit number right (i.e. /2)
shr dword ptr num1[4],1
rcr dword ptr num1,1
So why do you need to know about addition and shifting? Because you CAN'T use the 32-bit mul and div reliably! Remember you are using 64-bit numbers and mul and div can't hack 64-bit numbers.
So how to multiply by 10 (which is needed to convert to integer, right?)??
Well, multiply by 10 is:
10X
2(5X)
2(4X + 1X)
So you need to multiply by powers of two. And how to multiply by powers of two? Why shift, of course!!!
So, to multiply by 10, put the number in two registers, shift the registers left twice, add the original number, then shift the registers again.
Have fun! And make sure you check your numbers...
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."