Is it possible to enlarge the stack frame like this:
subq $1, %rsp
if we just want to store a char
on the stack (for example).
Or do we need to enlarge the stack by a multiple of 8 or something. Is there any alignment?
Simply put, "Yes." You can enlarge the stack frame precisely in the way that you have indicated. However, as you ask in the rest of your question, you may run into stack alignment issues.
These issues will rarely cause problems within your own code. Honestly, you can manage the stack and pass parameters in any way that you'd like as long as you're not violating some architectural limitation.
However, to interoperate with system and library calls, stack alignment will generally be a requirement. You might find this document useful. Just as one example, GCC under Linux on x86 and x86_64 expects (enforces) 16 byte alignment of the stack and uses cdecl
.
You would want to locate any calling standard and alignment requirements in the reference documents for the platform and libraries that you're working with.