flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
Terje Mathisen 16 Sep 2005, 09:51
I wonder one thing:
You have obviously saved MUL operations by avoiding the need for back-multiplication and subtraction, so just to be certain: Have you done either a mathematical proof or an exhaustive test to verify that your shortcut does work for all possible 32-bit inputs? Terje |
|||
![]() |
|
El Tangas 16 Sep 2005, 18:45
Yes, I tested for all 32 bit numbers, by converting to ASCII and back, and comparing with the original value.
In fact, I had to add some code to increase the precision, because the test failed the first time. |
|||
![]() |
|
Terje Mathisen 19 Sep 2005, 10:44
Quote:
Right, that was why I asked. If the initial reciprocal MUL had been a bit more prescise, then the fractional result would have been directly usable for the lower 5 digits of the result. Terje |
|||
![]() |
|
Madis731 16 Mar 2007, 15:18
64-bit!
![]() I discovered 2 things: 1) lea r32/64,[r32/64+0c0000000h] doesn't work because of the encoding limits. This introduces more code and 2) you can fuse two magics into one possibly reducing code this may result in a third interesting thing, that you can do INT64_2_ASCII conversion...well, lets see |
|||
![]() |
|
Goplat 16 Mar 2007, 15:39
What kind of program does enough number to ascii conversions to make this worthwhile?
|
|||
![]() |
|
roboman 17 Mar 2007, 19:38
Any program that displays at least one number on the screen and you have more of a need to save a few clock cycles then a few bytes. Coming to mind is nearly any thing that displays changing numbers on the screen in real time (or game time) and will be run on a pc with more ram then you are going to use.
Thanks, very cool code, will have to add that to the collection. |
|||
![]() |
|
Madis731 22 Mar 2007, 12:59
Already used it, but I hope to make it use all the 64-bit features so I can save a few bytes
![]() Where can it be used is of course outputting numbers for users. Internally you don't need that, but you really need to show decimals to an average person who reads the outcome. My application was converting statistics to number format: A,5, B,3, etc. the zeros can be removed by simple compare loop which is penalty-hungry when not taken care of, but can be fast. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.