I used static member in class and reference to assembly, in sperate files I got error, Is there anyway to solve it?

Thank you for your kindly help, the reason way to use individual file with class in assembly is because to optimize the performance and also keep program reusable, thanks for all your help, so far I'm using data pointer to do this, and work fine.. I put those file here in case someone needs it.
at least It's one solution
and maybe later we can find out better way to solve it .

thanks again.. to eveyone who helps me... :slight_smile:

the example files that I currently used, list as following...

ErrorTest.ino

#include "MyClass.h"

void setup() {
    Serial.begin(115200);
    Serial.print("check before setVariable = "); Serial.println(*check._MyVariable);
    check.setVariable(1000);
    Serial.print("check variable MyClass.MyVariable = "); Serial.println(*check._MyVariable);}

void loop() {
}

MyClass.h

#ifndef MyClass_H
#define MyClass_H
#include "arduino.h"

class MyClass {

    public:
        MyClass();
        ~MyClass();
        void setVariable(int);
        int *_MyVariable;
    private:
        static int  MyVariable;
};


extern MyClass check;    
    
#endif
     

MyClass.cpp

#include "MyClass.h"

int __attribute__((used)) MyClass::MyVariable __asm__("MyVariable");

MyClass::MyClass(){
    MyVariable = 0;
    _MyVariable = &MyVariable;
};
MyClass::~MyClass(){
};

void MyClass::setVariable(int input){

    register uint8_t tmp;
    __asm__ __volatile__(
        "mov %0, %A1\n\t" \
        "sts MyVariable, %0 \n\t" \
        "mov %0, %B1\n\t" \
        "sts MyVariable+1, %0\n\t" \
        ::"r" (tmp), "r" (input) :
    );
};

MyClass check;