|
|
View previous topic :: View next topic |
Author |
Message |
Carl Tashian Guest
|
#locate usage |
Posted: Mon Nov 26, 2001 8:06 am |
|
|
I'm using #locate to reserve space for variables.. and I wonder, does #locate know the size of the variable being located? Can it prevent entire structs from being clobbered, or does it just handle the built-in types?
Thanks,
Carl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1316 |
|
|
Tomi Guest
|
Re: #locate usage |
Posted: Mon Nov 26, 2001 11:40 am |
|
|
The size of the type is reserved.
A sample list:
typedef struct {
char c;
float f;
int16 i;
} struct1;
char c1,c2;
char i;
struct1 y;
#locate y = 0x22 // the struct is 0x22-0x28 (last byte)
c1=c2=0;
i = 10;
y.i = 20;
.................... c1=c2=0;
0019: CLRF 2A
001A: MOVF 2A,W
001B: MOVWF 29 // c1 var. @0x29
.................... i = 10;
001C: MOVLW 0A
001D: MOVWF 2B
.................... y.i = 20;
001E: CLRF 28 // the last element (int16) of the struct
001F: MOVLW 14
0020: MOVWF 27
:=I'm using #locate to reserve space for variables.. and I wonder, does #locate know the size of the variable being located? Can it prevent entire structs from being clobbered, or does it just handle the built-in types?
:=
:=Thanks,
:=Carl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1321 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|