Here is a brief snippet that opens a file and it works
.OpenF: xor rsi, rsi ; flags = O_RDONLY
mov rdx, rsi ; mode = NULL
mov rax, rdx
mov al, SYS_OPEN ; = 2
syscall ; Open file
or rax, rax
jle .Exit
Excerpt man 2 open on my system Ubuntu 12.04
RETURN_VALUE:
open () and creat () return the new file descriptor, or -1 if an error occurred ( in which case, errno is set appropriately )
1: When a valid descriptor is returned it is in RAX
2: When an error occures, ECX = -1 and errno in RAX as a negative value
Questions:
1. Is what I've gleaned from experimentation correct in so much as values being returned by 64 bit and syscall
2. Is there something already available that will return a point to text denoting the error.
For my own purposes and maybe as a benefit to others I want to hammer out an algo where registers are setup in the same manner as a syscall invocation, but my procedure would leave all registers unchanged except RAX if successful, or ZR=1 and RAX = errorno if call failed and RSI a pointer to ASCII string indicating what the error is.