Is there a way to use a struct from C inside the Assembly code?
When I have this in C:
then I'd like to do something like this in Assembly:
I wouldn't mind having to import each variable separately:
But one thing I wouldn't want to do is using absolute address offsets, the way the automatically generated code does it:
Because that's just crap since you have to manually keep an eye on every possible reordering of the variables.
When I have this in C:
Code:
struct MyStruct
{
unsigned char Value1;
unsigned char Value2;
unsigned char Value3;
};
struct MyStruct StructVar;
{
unsigned char Value1;
unsigned char Value2;
unsigned char Value3;
};
struct MyStruct StructVar;
then I'd like to do something like this in Assembly:
Code:
LDA _StructVar._Value1
I wouldn't mind having to import each variable separately:
Code:
.import _StructVar._Value1
.import _StructVar._Value2
.import _StructVar._Value3
.import _StructVar._Value2
.import _StructVar._Value3
But one thing I wouldn't want to do is using absolute address offsets, the way the automatically generated code does it:
Code:
LDA _StructVar + 1 ; Load StructVar.Value2
Because that's just crap since you have to manually keep an eye on every possible reordering of the variables.