The programming of microcontrollers is essential for their correct operation, high computational efficiency, low-power solutions, and it is also key to get the most out of their capabilities with the hardware features that each of the microcontroller families has. There are different programming languages that can be used in microcontrollers, in this work we will focus on C and Assembler. C is one of the most widely used due to its efficiency and its ability to control the hardware directly. Assembly is a low-level language that allows more control over the instructions executed in the microcontroller, two songs have been implemented in assembler and C languages and the resources used for their execution on a Microchip PIC16F877 have been analyzed. The research results allow the developer to obtain results for a selection of the optimal hardware platform as well as the programming language according to the required memory utilization. Coding performed in MPLAB software with the asm and XC8 compilers, indicate that the C-code programs cover a larger amount of memory close to 4 times greater or higher.