Ok, at first a hello everyone. I'm familiar with asm (see the link in my sig if you wish) but this win32 coding is killing me.
What to say to the linker that it wouldn't add A LOT of imports to functions I've even heard of? Like, the std "Hello World!" proggy is a 4k file with basically no stuff in the .exe than the code, zeros and some other stuff. Now, when I've used a few imports like "GetModuleHandleA", "ShowCursor" etc. (I believe DirectX stuff doesn't add much to the filesize, except codewise) the .exe is suddenly 8k and there is that forementioned bunch of imports.
Not that this was very annoying (I can always pack the .exe to something like that 4k, yes, I try to code a 4k intro) but I'd really like to know how to cut the file size without any magic.
What to say to the linker that it wouldn't add A LOT of imports to functions I've even heard of? Like, the std "Hello World!" proggy is a 4k file with basically no stuff in the .exe than the code, zeros and some other stuff. Now, when I've used a few imports like "GetModuleHandleA", "ShowCursor" etc. (I believe DirectX stuff doesn't add much to the filesize, except codewise) the .exe is suddenly 8k and there is that forementioned bunch of imports.
Not that this was very annoying (I can always pack the .exe to something like that 4k, yes, I try to code a 4k intro) but I'd really like to know how to cut the file size without any magic.
Ok, thanks! I found out a trick to get int 4096b... i.e. putting all data and structures in .code area so there's not .data... the imports are still there though.
That is:
-----
.data
number dd 42
.code
start: ret
end start
------
becomes...
------
.code
number dd 42
start: ret
end start
------
That is:
-----
.data
number dd 42
.code
start: ret
end start
------
becomes...
------
.code
number dd 42
start: ret
end start
------
If you write to data in your .code, be sure to make the code segment
writeable :)
writeable :)
f0dder: Of course, of course. I actually have a little patcher in my assy.bat that automatically does that. I'm in love with smc :) I really think that's one of the best parts in asm coding. Dunno if it's any faster nowadays but it sure is damn leet. :)