flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > "db (-1) shr 1" results into "value out of ra Goto page Previous 1, 2 |
Author |
|
edemko 08 Sep 2010, 10:42
Tomasz, provide some proof - i do not understand.
Some life situation... |
|||
08 Sep 2010, 10:42 |
|
edemko 08 Sep 2010, 20:01
There is another way when bit65 says "-" or "+" and modulo values stored in preceding 64 bits.
Such method widens number spectrum. Positive and negative values lay same magnitude differing in their signs only. There will be no ambiguity. Number operations must be changed then too. Look how easy multiplication then is: Code: result = abs1 * abs2 ;this goes to 64bits sign = (abs1.sign + abs2.sign) and 1 ;this goes to bit65 = abs1.sign xor abs2.sign sure, 00b + 00b and 01b = 00b ;+ * + = + 00b + 01b and 01b = 01b ;+ * - = - 01b + 01b and 01b = 00b ;- * - = + eq 0 xor 0 = 0 0 xor 1 = 1 1 xor 1 = 0 etc etc |
|||
08 Sep 2010, 20:01 |
|
revolution 08 Sep 2010, 20:08
xor is then same as add (and sub) if you ignore the carries. GF(2^n) uses xor as the additive/subtractive operation.
Last edited by revolution on 08 Sep 2010, 20:08; edited 1 time in total |
|||
08 Sep 2010, 20:08 |
|
Tomasz Grysztar 08 Sep 2010, 20:08
edemko wrote: There is another way when bit65 says "-" or "+" and modulo values stored in preceding 64 bits. No, it does not - it actually has narrower number spectrum than regular 65-bit encoding, because it allows range -(2^64-1) to 2^64-1, as it is not able to encode the -2^64 number. It loses this one encoding, because it has both the negative and positive zero, and so it is able to encode one number less than the standard scheme (which is a truncated 2-adic numbers scheme). |
|||
08 Sep 2010, 20:08 |
|
edemko 08 Sep 2010, 20:31
Seems you are right.
2-complementation implies easy computation through addition when subtraction needed, bothers mult. and div., ensures logical evaluation: shl/shr etc as no number conversion needed. Eh. I've found the solution - use qwords |
|||
08 Sep 2010, 20:31 |
|
edemko 08 Sep 2010, 20:33
revolution: commonly i avoid big theories, your the only sentence is more comprehensive those texts are
|
|||
08 Sep 2010, 20:33 |
|
edemko 09 Sep 2010, 03:44
Tomasz.
Soon or later there will be an overflow. Bit 65 postpones it. User allowed inputting composite nums which can be overflow condition once. Will fasm say: "the expression can not be evaluated" ? Why not to leave it and count the way CPU does. |
|||
09 Sep 2010, 03:44 |
|
Tomasz Grysztar 09 Sep 2010, 07:43
edemko wrote: Soon or later there will be an overflow. edemko wrote: Why not to leave it and count the way CPU does. edemko wrote: commonly i avoid big theories |
|||
09 Sep 2010, 07:43 |
|
Tomasz Grysztar 09 Sep 2010, 08:38
revolution wrote: xor is then same as add (and sub) if you ignore the carries. GF(2^n) uses xor as the additive/subtractive operation. revolution, if you are interested in such topics, you may find this related: http://www.emis.de/journals/UIAM/PDF/46-21-30.pdf (the bitwise XOR and AND are mentioned there, though under a different nomenclature). |
|||
09 Sep 2010, 08:38 |
|
edemko 09 Sep 2010, 10:35
Tomasz wrote:
Will next fasm deny this "dq 18'446'744'073'709'551'615 + 18'446'744'073'709'551'615"? In my vision that seems a non-needed service. qword->dword/word/byte and vice-versa important. Tomasz wrote:
No. Book looks good. |
|||
09 Sep 2010, 10:35 |
|
revolution 22 Jan 2011, 08:27
Tomasz Grysztar wrote:
|
|||
22 Jan 2011, 08:27 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.