News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Large numbers

Started by clamicun, August 30, 2021, 03:33:55 AM

Previous topic - Next topic

daydreamer

yet another nitpick,when measure file sizes are seen explorer in check file size=two file sizes,first file size is for example 21345 bytes,second is file size on disk evenly divided by block size ca 24 k,file size on disk is 4k(4096b) blocks or other size if formatted different
also testwrote 13gb max sized file on mechanical drive,but only 1gb max on my SSD

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

clamicun

Thanks to everyone who participated in this topic.
I understand - at least theoretically - everything.
And everything works fine with defined qwords.

qword num1 4294967297
qword num2 103
result 4294967400
which I can print with Raymonds qw2ascii proc.

The problem is, that the value of the second qword is only available after some other operation.
And still I don't get the value in eax  into that second qword.

raymond

Quote from: clamicun on September 02, 2021, 10:42:12 PM
The problem is, that the value of the second qword is only available after some other operation.
And still I don't get the value in eax  into that second qword.
If you explain the purpose of that qword num2 (assuming that is your "second qword") and how you are using it without being able to get its value, we may be able to help.
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com

clamicun

#18
The value of the second keyword num2 is produced in eax and I don't know how to put eax  into that qword.
Excuse me.
"Blind alarm"
By now I know how to store eax in a qword.

mineiro

Quote from: clamicun on September 02, 2021, 10:42:12 PM
I understand - at least theoretically - everything.
The value of the second keyword num2 is produced in eax and I don't know how to put eax  into that qword.
I suppose you're looking to this with decimal numbers in mind instead of binary.
4294967297 == 100000000000000000000000000000001

Well, if you sum 2 numbers in decimal base, but each one have only one digit, how to proceed?

  9
+ 2
-----
  ?

The symbol 9 is the last possible, so, "register" is full. If we add anything bigger than 0 to symbol 9 an overflow will occur. But we have only one digit to play, and one digit only cannot hold that sum. We need create a digit to the left side (high part) so result can hold that sum.
Only result need be "expanded,extended", because we will continue adding only one digit in decimal base.


I put side by side to show you an invisible thing happening. The sum bellow in decimal base don't overflow, everything fits in result. But if you look to this in binary, you will see an overflow happening.

4294967295     ;32 bits                                        11111111111111111111111111111111
0000000002     ;32 bits                                        00000000000000000000000000000010
-----------
4294967297     ;64 bits        0000000000000000000000000000000100000000000000000000000000000001
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

clamicun

Obrigado mineiro.
I solved the "problem".
It is not that difficult to store eax in a qword.