flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
vid 03 Jun 2007, 19:13
Quote: I've noticed there are alot of functions out there that aren't documented, but are used in examples throughout the web like what? you mean MASM32 "library" functions? |
|||
![]() |
|
kohlrak 03 Jun 2007, 19:29
auxDIBImageLoad() is one of the functions that's not documented anywhere. MSDN has nothing on it. Where's it located? Luckily, that one has enough examples to find out what the input and return is, but while looking it up i noticed that there's a joke going around that the aux functions could be calling mars for all we know. After noticing this, i realized that there are probably more functions in windows that really aren't documented well. And then there's always the problem of a lack of warning. Some functions don't work without another one being called first or one being called after it, and documentation dosn't warn you about it. Which is why i like assembly, you don't just take code and say "welp, it works, so i'll put it into a library then some idiot can use it even if he dosn't know what's going on." I feel for resons like this, examples in fasm not only just help fasm programmers, but programmers for all assemblers and programming languages, so they have a better understanding of what's needed, and what was placed there because it worked in some one's example. That's what i loath about HLLs, but this is off topic and for another discussion...
|
|||
![]() |
|
LocoDelAssembly 03 Jun 2007, 19:54
Maybe because it is not an API at all? By dissasembling a NeHe tutorial you will figure out that that function is linked statically.
|
|||
![]() |
|
kohlrak 03 Jun 2007, 21:07
I've never looked around though compiled exes much, but i have a theory that just about everything is linked statically when it goes through a compiler.
|
|||
![]() |
|
vid 03 Jun 2007, 21:28
yes, it's a openGL function, no reason be on MSDN.
Quote: I've never looked around though compiled exes much, but i have a theory that just about everything is linked statically when it goes through a compiler. depends on how you define "going through compiler" ![]() |
|||
![]() |
|
kohlrak 03 Jun 2007, 21:34
MSDN, for some odd resons, lists other opengl functions. Don't know why it'd be excluded.
As for how i define compiler, i mean being thrown through something like visual studio's massive collection of programs that do alot of things that are a major mystery to us. |
|||
![]() |
|
LocoDelAssembly 03 Jun 2007, 22:17
But the documented OGL functions comes with Windows while the glaux auxDIBImageLoad function don't, you need to get the .lib file and link to it. Here you have some info about glaux http://members.cox.net/scottheiman/opengl.htm
|
|||
![]() |
|
vid 03 Jun 2007, 22:33
Quote: As for how i define compiler, i mean being thrown through something like visual studio's massive collection of programs that do alot of things that are a major mystery to us. not to me ![]() you are not right then. for example all DLL stuff is linked dynamically. |
|||
![]() |
|
kohlrak 03 Jun 2007, 22:42
Then what *IS* all that junk being thrown into a program using cout << that compiles to 256kb? XD
|
|||
![]() |
|
moveax41h 23 Jul 2018, 16:20
How do you do this on Linux?
|
|||
![]() |
|
fasmnewbie 23 Jul 2018, 20:36
It's pretty straightforward if you are familiar around the use of file descriptor
1. Just get a file descriptor ("theFile.txt","r") from an opened file. 2. Feed RAX (the return value, FD) into FILE *stream argument The rest is quite straightforward I think (buffer, size). You can use printf to print the content the returned buffer. Don't forget to close the FD using fclose(fd). Here's something similar on Win64, different calling convention of course Code: ; gcc -m64 this.obj -o this.exe format MS64 COFF public main extrn fgets extrn fopen extrn fclose extrn printf section '.data' writeable stream db 'theFile.txt',0 ;put some text in here mode db 'r',0 strs rb 1000 ;save buffer 1000 bytes section '.text' executable main: sub rsp,40 mov rdx,mode mov rcx,stream call fopen mov r15,rax ;save file handle mov r8,rax ;FILE stream mov rdx,500 ;int n. read first 500 characters mov rcx,strs ;char *str call fgets mov rcx,r15 ;close file handle call fclose mov rcx,strs call printf add rsp,40 ret |
|||
![]() |
|
fasmnewbie 23 Jul 2018, 20:58
I wasn't aware that this is an 11 year old thread.
Never mind, at least it finally wakes up to a 64-bit code! How time flies... |
|||
![]() |
|
revolution 23 Jul 2018, 21:16
fasmnewbie wrote: I wasn't aware that this is an 11 year old thread. |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.