how do i convert a code written in keil into a hex file?
Compile the code, and have the linker generate a hex file. Check output options for the project.