NASM - The Netwide Assembler
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Calendar
Login
Register
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Setting the RSI flags register for system calls
« previous
next »
Print
Pages: [
1
]
Author
Topic: Setting the RSI flags register for system calls (Read 9515 times)
jedi
Jr. Member
Posts: 9
Setting the RSI flags register for system calls
«
on:
July 17, 2013, 04:17:33 PM »
The documentation for the Linux open() system call says that the RSI register stores a series of OR'd values for flag instructions. It then lists a bunch of options in alphabetical order. I've been having trouble figuring out which options are which bits, does anyone mind taking a look and explain to me how one goes about this. This will help me for error codes and future functions too. Thank you.
Logged
Rob Neff
Forum Moderator
Full Member
Posts: 429
Country:
Re: Setting the RSI flags register for system calls
«
Reply #1 on:
July 17, 2013, 04:27:45 PM »
One simple method is to grep through the <sys/stat.h> or <fcntl.h> files in gcc's include directory for the defines such as O_RDONLY, O_WRONLY, O_RDWR, etc.. Those will be the bits you seek.
Logged
jedi
Jr. Member
Posts: 9
Re: Setting the RSI flags register for system calls
«
Reply #2 on:
July 17, 2013, 04:51:32 PM »
I think your method is the best/only way I suppose. Grep'ing is a pain because it's hard to find the right file. I searched for and found what I needed in here:
http://lxr.linux.no/linux+v3.10.1/include/uapi/asm-generic/fcntl.h#L19
Logged
Print
Pages: [
1
]
« previous
next »
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Setting the RSI flags register for system calls