flat assembler
Message board for the users of flat assembler.
Index
> Linux > fasm and using Linux' resources |
Author |
|
Dryobates 06 Jan 2005, 20:57
Ton wrote: Okay I new to assembly, browsed a while, finding my way, and have some questions: argc - first on stack argv - next elements on stack until NULL apear. Quote: 2) Are all registers available to me? What is common practice? I don't know how it is on Linux (I use FreeBSD) but probably all generall registers are for your usage. Quote: 3) Where can I find examples on how to invoke system calls. Primarily to have access to stdin, stdout, stderr, and file access. eax - syscall number ebx, ecx, edx, esi, edi, ebp - parameters (first in ebx, second in ecx etc.) int 80h stdin = 0 stdout = 1 stderr = 2 stdcall: 3 - read 4 - write 5 - open 6 - close I'm sure that there's something like syscalls.master on linux too. Just search for it. Quote: 4) Suppose I want to let talk two fasm programs, what is preferred? If in one way then pipes. If two ways I would use sockets.undefined |
|||
06 Jan 2005, 20:57 |
|
gunblade 20 Jan 2005, 15:22
Hey,
What Ton said was right For question 3, read the file /usr/include/asm/unistd.h (default location) it has a list of every syscall you can make, and next to it, a number which you put into eax, when calling int 0x80 (put simply ) (These arent api calls.. if you actually want api calls, you'll have to call the functions in glibc.. then link your program with ld.. but its really uneccessary, the interupt call method calls the kernel directly, (smaller file size, no requirement for an external library, faster)) For question 4, you could always use TCP/UDP/RAW sockets.. make one listen on the localhost, and make the other connect.. or if you want something more direct, use threads, or pipes. good luck, gunblade |
|||
20 Jan 2005, 15:22 |
|
Ton 20 Jan 2005, 18:34
I aware of TCP/UDP, sockets, and pipe. I will look into this with fasm. I think it is also time to look into threads.
I think it is a bad idea to link libc, not I realize I have direct access to the kernel. One might better link in the dld, and dynamically load what is wanted. For now this is above my capabilities. Thanks for the answers. I can enjoy this new knowledge. Ton |
|||
20 Jan 2005, 18:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.