flat assembler
Message board for the users of flat assembler.
Index
> Windows > Win64 DirectDraw example |
Author |
|
Tomasz Grysztar 17 Sep 2006, 18:00
With the new Win64 headers coming I've also made a small DirectDraw example for x64 Windows. I have also copied a code from my good old fractal example from DOS fasm's package, so that it demonstrates that FPU instructions still work in the Win64 world (even though perhaps SSE is much more efficient and easier to handle).
Quick help for when the program is working for you: left click to zoom in, right click to zoom out, Esc ends the program. PS. By utilizing the SSE and the capabilities of duo-core processor this could be perhaps done to go increadibly fast compared to this one, even without using any of the tricks usually done to speed up Mandelbrot fractal computations. But I just got it working and that all I needed for now - it appears that Win64 programming is not so bad afterall. Even though I still don't fully understand the proper internal alignments for some of the structures.
|
|||||||||||
17 Sep 2006, 18:00 |
|
LocoDelAssembly 18 Sep 2006, 00:20
Nice demo (yes, I have the trial now )
BTW, where can I check how much time left before the trial expires? |
|||
18 Sep 2006, 00:20 |
|
Feryno 18 Sep 2006, 08:25
2 vid
I don't know whether this is example which you though about, please try it it does: 1. it installs exception handler 2. it causes exception, so it triggers exception handler 3. exception handler continues execution (increase RIP to point after instruction, since we know size of opcode... for applications it would be necessary to determine opcode size - we can use disasm engine of fdbg... maybe there is another way to skip instruction causing exception without calculating its size ?) http://board.flatassembler.net/download.php?id=2376 |
|||
18 Sep 2006, 08:25 |
|
vid 18 Sep 2006, 09:02
no, you are using dynamic exceptions handler. there is also a "static" exception handler (data directory 3 of PE executable), and this to my knowledge is not supported by any other assembler
|
|||
18 Sep 2006, 09:02 |
|
MazeGen 18 Sep 2006, 11:13
vid wrote: and this to my knowledge is not supported by any other assembler MASM supports "static exception handlers", to be exact, "Unwind Data for Exception Handling". |
|||
18 Sep 2006, 11:13 |
|
vid 18 Sep 2006, 12:48
oh... of course, i forgot
|
|||
18 Sep 2006, 12:48 |
|
Tomasz Grysztar 19 Sep 2006, 11:21
vid wrote: i believe, mainly after discussion with feryno, that 16b alignment was introduced in this way(...) I did not mean this one alignment actually. I'm talking about the alignment fields that have to be added in some structures to get the long ptr fields aligned on natural boundary. The structure declarations are exactly the same as in Win32, however their translation to binary differs. |
|||
19 Sep 2006, 11:21 |
|
Tomasz Grysztar 21 Sep 2006, 18:46
I rewrote it to use SSE (since it is available on all x86-64 processors, its use should be promoted , I even used one SSE3 instruction initially but later realized that AMD64 may not have it) and now it's one of the official examples in the fasm for Windows package (in the EXAMPLES\WIN64 subdirectory).
Funny, while doing this I found one more bug with the MOVQ instruction and fixed it. Enjoy the new fasm's release! PS. The SSE version isn't actually faster than FPU one was - perhaps some more work would be needed to do so (however this also shows that use of good old stack-based FPU instruction may still make sense even on modern processors - they seem to work quite fast, too), and this one can be at least more easily read and understand (if you know the instructions, of course). |
|||
21 Sep 2006, 18:46 |
|
LocoDelAssembly 22 Sep 2006, 02:18
SSE3 support has started with the Venice cores (the one I have).
Well, I always say this but I'll say it again, my maths skills can be compared with the ones of a 7 years old kid (and he wins me), but I think that replacing FPU with SSE is evil, you have less precision with it and if you are not planning to do any parallel calculations I don't see why it should be used. PS: There is a SSE based mandelbrot benchmark on this forum, maybe you can borrow some ideas from it. [edit] Here it is http://board.flatassembler.net/topic.php?t=5122 OK, SSE is faster but it's unfair, SSE calculates with 64-bit precision while FPU precision is 80-bit[/edit] [edit2] OK, even changing the precision of the FPU my score is 130 and 170 with SSE. Next time I'll take some sleep before talking...[/edit2] |
|||
22 Sep 2006, 02:18 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.