How can I write some assembly code in my C program for compiling in KEIL compiler?
You could start by Reading The Fine Manual.