Usually such operations can be done in C.
For actual assembler either write an assembler source file containing C callable code (I think the Altera makefile will put a .S file through cpp and then gas), or use the gcc 'asm' statement to include the required instructions - these will tie C variables to registers as required.
There should be some exampler lurking in the .h files or more generally on the web.
NB: if you access any memory locations that C variables also access, then add a "memory" qualifier to the asm statement - otherwise gcc might optimise out the C code.