I want to load the Pointer of a Structure variable to a Register! The Structure Var can be a var.vector4 or *var.vector4
If I do this inside a Procedure it works with MOV for the *var and LEA for the var
But when I do the same from outside a Procedure I need MOV for both *var and var
I'm know I'm not following you entirely here (I've an infection and brain functions are impaired!) but I can see some problems.
1) The macro DbgREG is bugged. Where does _dbgval_ come from?
2) LEA and MOV perform two completely separate functions. LEA moves addresses into registers. MOV moves values stored in memory into/out of registers. I'm struggling to think of any situations when you would legitimately want to mix the two up. Use them together - yes often, interchange them - no.
3) There's no monolithic "variable storage space". Stuff ends up in various places depending on what type it is and in which scope it is defined.
Simple type (<= .I in size) local variables and parameters will end up on the stack. Global, main, static and shared variables will end up in the writeable data section. Complex types (simple strings and structures, arrays, lists, maps of any kind, memory blocks) will end up on the heap.
In the program's code everything will be referenced as an offset from the appropriate base pointer to their location if that's easy to manage, or an entirely separate pointer, if its not (e.g. lists, maps, blocks).