jim hamblen
/
C_to_asm
An example calling assembly from C. Assembly source is in a *.s file
main.cpp
- Committer:
- 4180_1
- Date:
- 2010-09-29
- Revision:
- 0:ef242c5b2981
File content as of revision 0:ef242c5b2981:
#include "mbed.h" // This progam will blink LED1 and LED4 // using assembly language for LED1 and // API functions for LED4 // declare external assembly language function (in a *.s file) extern "C" int my_asm(int value); // declare LED outputs DigitalOut myled1(LED1); DigitalOut myled4(LED4); int main() { int value = 0; // loop forever while(1) { //call assembly language function to control LED1 my_asm(value); //API function to control LED4 myled4 = value; // flip value and wait value = ~ value; wait(0.2); } }