Hi all, I'm new here and to fasm. Can someone let me know what I'm doing wrong here? Note that I actually am trying to do this with no direct WinAPI calls, but I wanted to try and use ExitProcess to also test that I can invoke Win API functions too in the same file. However, I am getting that ExitProcess doesn't exist which I find strange because it appears that I've properly imported it, no? Also, just FYI - I've confirmed that the Windows header files are working because I've included this exact file and also used ExitProcess in another program. Thanks.
include'WIN32AX.INC' include'macro/import32.inc' section".data"datareadablewriteable
bufsize = 4
main: invokescanf, "%s",buff
librarymsvcrt,'msvcrt.dll', kernel32, 'KERNEL32.DLL' importmsvcrt,\ ;from that specified library Notice how msvcrt is used to reference the previous declared library msvcrt as .dll
printf,'printf',\ scanf, 'scanf' importKERNEL32,\ ExitProcess, 'ExitProcess'
For new ASM programmers, access to APIs or 3rd party libraries is required as a tool of proofs only. C funcs are not requirement but to see what you've done to the registers, you need something like "printf" to confirm the effects of instructions that you composing. Some people prefer the debuggers.
My personal opinion is that ASM is best used if you want to talk to / interface the CPU directly albeit the noises coming from the OS's 'protectionism', calling conventions and other high-level stuff that have nothing to do with the instructions and the real CPU works. I'll leave that to high-level languages if I want to make 'apps' and projects.
ASM is something different, requires different set of thinking, skills and approach. You'll understand HLL much much better if you see it from ASM point of view. ASM builds strong characters . FASM's own design is reflecting that exactly. But be warned, FASM board is extremely low-level (as in machine) and comes with colorful languages, too!
You'll understand HLL much much better if you see it from ASM point of view.
I agree. In fact, I've only really understood pointers in C(++) after learning basic asm. Mind you, this is because when I started to seriously "learn" programming, I started with HLL books of course (I think I was 10 or so). And guess what? HLL books are full of bullshit analogies to describe pointers (as a child of course, you think of it that way must be true).
It sickens me to see HLL advocates teach "newbies" abstractions and all sorts of this kind of bullshit, no wonder so many people cannot understand pointers or find them "complicated" to use and prefer to "abstract" them away with crappy classes in C++. It's not even about asm vs HLL, but about the mindset.
The flat memory model (what pointers are in C/C++) is really simple by itself, and since everyone is taught arrays before pointers, it is even easier to understand. But of course, this is why HLL morons suck at teaching anything. Instead of "keeping it simple" they start with bullshit like phone addresses or other crap! WTF just tell them it's a fucking number in a RAM array.
Oh I forgot some people think that not teaching about bits to new programmers is a "good" way of teaching, because bit manipulations are placed at the end (building blocks of everything) of the course cause they're "omg complex for newbies". Pathetic to me.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum