Absolute addressing is done with the @ symbol. Look it up in your documentation.... But!!! The whole point of C is you don't need to know where it is..
If you get your head around pointers...
Code:
unsigned char variable; // create variable for data..
unsigned char* location; // create a pointer ..
location = &variable; // point at variable..
*location = 0x22; // assign variable..
Hi thanks for the reply. Actualy I know a bit about pointers.
Actually this is what I'm going to do.Let say I get numbers from 1 to 30.This number I must store in general purpose registers.
GP registers starts (declared) 40h onwards.
If it is 1 then it must store in 41h--now it contains 1
If it is 4 then it must store in 44h--now it contains 4
If it is 12 then it must store in 4Ch--now it contains 12
In assembly I do like this.
Code:
movf Zone_Number,W
addlw 40h ; add offset (because GP starts from 40h onwards)
movwf FSR
Place_Alarms movf Zone_Number,W
movwf INDF
Hi thanks for the reply. Actualy I know a bit about pointers.
Actually this is what I'm going to do.Let say I get numbers from 1 to 30.This number I must store in general purpose registers.
GP registers starts (declared) 40h onwards.
If it is 1 then it must store in 41h--now it contains 1
If it is 4 then it must store in 44h--now it contains 4
If it is 12 then it must store in 4Ch--now it contains 12