Skip to main content
Commonmark migration
Source Link

#trying to remane the variable

trying to remane the variable

#trying to use asm constraints

trying to use asm constraints

#a terribly awkward workaround

a terribly awkward workaround

#so my question is...

so my question is...

#trying to remane the variable

#trying to use asm constraints

#a terribly awkward workaround

#so my question is...

trying to remane the variable

trying to use asm constraints

a terribly awkward workaround

so my question is...

edited tags
Link
VE7JRO
  • 2.5k
  • 19
  • 28
  • 31
Tweeted twitter.com/StackArduino/status/895163123207897090
added 283 characters in body
Source Link

Looking at the object symbol table, the only label for global_var is a C++-like mangled name. No
However hard I tried this renaming trick, I could not bring the compiler to generate a my_var label seems to be generated.

__attribute__((always_inline)) pass_paramgive_me_my_friggin_variable(unsigned char data)
{
    asm volatile ("cmp  %0,%0\n"::"r"(data));
}   

ISR (TIMER2_COMPA_Vect, ISR_NAKED) {

    <some prologue to save SREG and all needed registers>

    //...

    give_me_my_friggin_variable(Driver.ISR_param);

    // continue assembly code with r24 properly initialized
}

Looking at the object symbol table, the only label for global_var is a C++-like mangled name. No my_var label seems to be generated.

__attribute__((always_inline)) pass_param(unsigned char data)
{
    asm volatile ("cmp  %0,%0\n"::"r"(data));
}   

Looking at the object symbol table, the only label for global_var is a C++-like mangled name.
However hard I tried this renaming trick, I could not bring the compiler to generate a my_var label.

__attribute__((always_inline)) give_me_my_friggin_variable(char data)
{
    asm volatile ("cmp  %0,%0\n"::"r"(data));
}   

ISR (TIMER2_COMPA_Vect, ISR_NAKED) {

    <some prologue to save SREG and all needed registers>

    //...

    give_me_my_friggin_variable(Driver.ISR_param);

    // continue assembly code with r24 properly initialized
}
Source Link
Loading