How to invoke a system call via sysenter in inline assembly (x86/amd64 linux)?

How can we implement the system call using sysenter/syscall directly in x86 Linux? Can anybody provide help? It would be even better if you can also show the code for amd64 platform. I know in x86...