In the light keyboard exercise, you relied on the compiler to solve some annoying tasks in embedded system programming, such as interrupt handler generation and language integration. Let's suppose now that you were supplied a very simple compiler that isn't able to perform such tasks. This a rather normal situation in embedded systems development and, if you're a privileged developer that has the proper tools available, knowing the details behind such tasks is never useless.
So try now to reimplement the light keyboard (specially the part in which the button must be pressed for four seconds before leds are lit) considering the following restrictions:
-S
and take a look at the generated assembly code. Pay attention on the code generated for the
interrupt handlers;objdump
from binutils to see the generated assembly code for your elf file. Take a look at what needs to be done before
running your main()
function;-nostartfiles -nodefaultlibs
will remove the interrupt vector and all initialization routines;