flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
gunblade
Thats indeed very impressive, could save some pressious cycles in certain situations. Any idea to the limits of the complexity of the function?
Thanks, gunblade |
|||
![]() |
|
decard
wow :O
|
|||
![]() |
|
Tomasz Grysztar
There are no limits to the complexity of function, but there are other limits: mainly that iterated searching for solution will actually fail in most cases of complex arithmetic equations - fasm's code resolving was designed to deal rather with code optimization than mathematic problems. The above is just a kind of curiosity.
|
|||
![]() |
|
RedGhost
i have used this for row/column pixel drawing in my hobby os in graphics mode
its alot easier than doing it in my head (i suck at math) and alot faster than letting it assemble with add, sub, div, and etc i found this out by accident, and it just made me love fasm even more! _________________ redghost.ca |
|||
![]() |
|
edemko
Code: x = (y-2)*(y+1)/2-2*y ;\ y = x+1 ; \ dd x,y ;/ my new signature on wasm.ru, thanks TG ;Having seen it my eyes became hugged with hands. ;Nice blast. ;Internals and thanks: x = (x+1-2)*(x+1+1)/2-2*(x+1) y = x+1 dd x,y |
|||
![]() |
|
ass0
Are you all being sarcastic? or i am missing something. =S
Code: x = (y-2)*(y+1)/2-2*y y = x+1 dd x,y ;6,7 Code: ;but this: x = (y-2)*(y+1)/3-2*y y = x+1 dd x,y;error: value out of range. Code: ;and this: x = (y-2)*(y+1)/2*y y = x+1 dd x,y;error: code cannot be generated. _________________ ![]() Nombre: Aquiles Castro. Location2: about:robots |
|||
![]() |
|
edemko
when i try compiling all 3 samples it says "symbol 'y' out of scope"
? |
|||
![]() |
|
baldr
ass0,
No wonder it gives you errors in latter two cases: it's all about the way fasm resolves dependencies. fasm doesn't try to solve system of equations: it performs multiple passes, up to 100 or whichever value you've specified in -p option (or Passes value in [Compiler] section of FASMW.INI), and uses some hints from previous passes to get closer to (or farther from) the solution (one of many possible, perhaps). Let's consider simple case: Code: sqrt = (25/approx+approx)/2 approx = sqrt+1 Pass 1: approx still not defined yet, but it has predicted value of 1 (from previous pass), sqrt is set to 13; approx receives new value of 14. Pass 2: sqrt = (25/14+14)/2 = 7; approx = 8. Pass 3: sqrt = (25/8+8)/2 = 5; approx = 6. Pass 4: sqrt = (25/6+6)/2 = 5; approx = 6. Solution is stable: there were no mispredictions during this pass, so it's final. Now take a look at Code: x = (y-2)*(y+1)/3-2*y y = x+1 Your next example exhibits another behavior: first pass finishes with (x, y) = (0, 1), second one with (-1, 0), next with (0, 1) and values oscillate so on, until compiler says it's tired. Corollary: fasm can do amazing things it's not supposed to, but you must know enough of its inner workings to be sure that the result is correct/reachable. ----8<---- edemko, Have you compiled exactly the code shown? |
|||
![]() |
|
ass0
Cooooool! Yet is a little dangerous feature. =D
_________________ ![]() Nombre: Aquiles Castro. Location2: about:robots |
|||
![]() |
|
edemko
baldr wrote:
all three ass0's samples in same order |
|||
![]() |
|
revolution
edemko wrote:
|
|||
![]() |
|
edemko
i do
Code: /* x = (y-2)*(y+1)/2-2*y ;\ y = x+1 ; \ dd x,y ;/ my new signature on wasm.ru, thanks TG ;Having seen it my eyes became hugged with hands. ;Nice blast. ;Internals and thanks: x = (x+1-2)*(x+1+1)/2-2*(x+1) y = x+1 dd x,y */ ;ass0 ;Are you all being sarcastic? or i am missing something. =S ;Code: x = (y-2)*(y+1)/2-2*y y = x+1 dd x,y ;6,7 ;Code: ;but this: x = (y-2)*(y+1)/3-2*y y = x+1 dd x,y;error: value out of range. ;Code: ;and this: x = (y-2)*(y+1)/2*y y = x+1 dd x,y;error: code cannot be generated. |
|||
![]() |
|
revolution
You have to do each as a separate file. You can't combine all three together like that unless you change the variable names.
|
|||
![]() |
|
baldr
revolution,
Not a completely new definition of "all 3 samples", but I'm shocked. ![]() |
|||
![]() |
|
edfed
it is simply amazing how nature is...
just see it as a basic rule of a world (fasm directives resolution), and then, see how the simple rule for resolution can give complex results. exactlly as particles, two particles of same charge will repulse. then, put a lot of particles in vacumm, and lets play the nature, the sun appear, planets, humans, and computer with fasm "installed". ![]() some 256 bytes demos uses only few instructions and will give really cool effects. the rules are the engine of a game. |
|||
![]() |
|
revolution
Simple rules can give complex results.
Anyone up for a game of Go? |
|||
![]() |
|
baldr
|
|||
![]() |
|
ender
As for Go - I'm in. I'm not very strong but... well, I may take the goban with me - anyone for a little bit of tournament?
![]() _________________ &r |
|||
![]() |
|
vid
ender: I never played it "in real", and I would enjoy trying it out.
|
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.