flat assembler
Message board for the users of flat assembler.
Index
> Linux > [SOLVED] 64bit opengl call trouble... |
Author |
|
eilenbeb 18 Feb 2010, 01:23
Hmm... I'm afraid I don't know fasm's macros well enough to understand how that works, or how to rewrite it for 64bit.
I tried using things like mov eax,0.5 mov rdi,rax but still no results. Going to try the vector form of the functions, I guess. |
|||
18 Feb 2010, 01:23 |
|
eilenbeb 18 Feb 2010, 02:06
Strange, someone responded but now their post isn't there anymore...
Anyways, using the vector forms of glVertex didn't get me anywhere. I either get nothing at all, or the verts are way off-screen. I'm stumped. |
|||
18 Feb 2010, 02:06 |
|
eilenbeb 18 Feb 2010, 02:20
Solved. I went through all of the glVertexXXX's until one worked.
Turns out that glVertex3fv works with floating point values defined as doubles in the data section. Couldn't get any of the others to work. |
|||
18 Feb 2010, 02:20 |
|
windwakr 18 Feb 2010, 02:47
eilenbeb wrote: Strange, someone responded but now their post isn't there anymore... Uh yeah.....that was me. I didn't read your post fully and assumed calling was stack based, not register based. That's why I posted to look at that pushd macro, and also why I deleted my post. I need to stay out of subforums I know nothing about. |
|||
18 Feb 2010, 02:47 |
|
bitshifter 18 Feb 2010, 05:47
eilenbeb wrote: Solved. I went through all of the glVertexXXX's until one worked. Any of the v-appended gl calls expect a pointer to an array, not a single value. Also, your macro look like some type of fastcall, where normally stdcall is used. Meaning the values are pushed onto the stack instead of passed in registers. Please post an attachment of your code so we can have a look-see... _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
18 Feb 2010, 05:47 |
|
LocoDelAssembly 18 Feb 2010, 06:34
bitshifter, this is 64-bit code and it is Linux forum so no stack nor stdcall (32-bit code typically use cdecl) is commonly used here.
eilenbeb, I think that float values are passed in xmm registers. [edit]Yep, xmm registers. Take a look at this: http://board.flatassembler.net/topic.php?t=10553 . I have no reasons to suspect about the correctness of the macros, but since perhaps them were not extensively tested some things may be wrong so make sure to read the Linux ABI (some post there has a link). Also note that fasm now has extended support for ELF so you no longer need to create raw binaries as in those macros.[/edit] [edit2]Well, the link is not there so here it is: http://www.x86-64.org/documentation/abi.pdf . In a quick look I think I saw that kohlrak's invoke uses all of the xmm registers to pass arguments but the specs uses from xmm0 to xmm7 only.[/edit] |
|||
18 Feb 2010, 06:34 |
|
bitshifter 18 Feb 2010, 07:11
LocoDelAssembly wrote: bitshifter, this is 64-bit code and it is Linux forum so no stack nor stdcall (32-bit code typically use cdecl) is commonly used here. How cool is that! _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
18 Feb 2010, 07:11 |
|
kohlrak 26 Feb 2010, 12:36
LocoDelAssembly wrote: bitshifter, this is 64-bit code and it is Linux forum so no stack nor stdcall (32-bit code typically use cdecl) is commonly used here. To be honest, i never really tested the floating point stuff too extensively, especially since i'm not really good with sse. In light of this topic, i have updated it. Anyway, here's some c code and it's -S output. I guess i got lucky on this one... EDIT: Jumped the gun... only the first 8 (0-7) are used. I didn't notice that they were moved to the stack after conversion to double. |
|||
26 Feb 2010, 12:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.