2006-02-22 05:22 AM
2006-02-17 07:06 AM
Hello every body,
I want to declare a big table in a RAM and there isn’t any space in zero page. So, I have tested this code : In main @data1 char tab[6][50]; And in .lkf +seg .data1 –b0x0100 The compiler said : unknown space: data1 After, I have tested : In main char tab[6][50]; tab = 0x0100; The compiler said : redeclared external tab So, I don’t know what to do… Thank philippe2006-02-20 08:30 PM
Philippe,
the correct syntax for what you are trying to do is explained . If all you want to do is make sure that your table is not in page zero, it is not necessary to specify an address for it, you just write @near char tab[6][50]; no modification in the linker file is required in this case; the linker will decide by itself the address of your table in the 16 bit address space (that is, out of page zero). Regards, Luca (Cosmic)2006-02-21 12:14 AM
My problem is : when I read
Char tab[6][50]; in main The compiler said : #error clnk sample.lkf:1 bad address (0x1dc) for zero page symbol c_y #error clnk sample.lkf:1 bad address (0x1e6) for zero page symbol _dec_byte_F$L #error clnk sample.lkf:1 bad address (0x1d6) for zero page symbol c_lreg #error clnk sample.lkf:1 bad address (0x1de) for zero page symbol _rempli$L #error clnk sample.lkf:1 bad address (0x1da) for zero page symbol c_x #error clnk sample.lkf:1 bad address (0x1ee) for zero page symbol _pwd$L #error clnk sample.lkf:1 bad address (0x1d2) for zero page symbol c_lacc What I don’t know. If I just do that : @near char tab[6][50]; The compiler said that #error clnk sample.lkf:1 bad address (0x100) for zero page symbol _tab So, I’m lost. :-[ [ This message was edited by: Philippe13 on 21-02-2006 15:19 ]2006-02-21 08:48 PM
nobody have a good idea for me ?
2006-02-21 09:17 PM
How many 16bit addressable RAM do u have? Are u sure thart u have enough space to reside array there? Check linker memory settings.
2006-02-21 11:06 PM
Philippe,
my previous answer only addressed how to manage the address of the objet, but your current problem comes from the fact that the specific array you are using is bigger than 256 bytes. Supposing that your ST7 derivative has enough memory to manage such a big object, you can't put it in page zero because it's not big enough (that would result in the errors you have seen or in other possible compiler or linker errors), so you have to put it in the ''long'' addressing range. Even here, you must be careful, because if you use page 1 the object will overlap with the stack. Try the following (change the table name to make sure you are not using the same symbol twice):Code:
@near char mytab[6][50]; and, in the linker fileCode:
+seg .data -b 0x200 that will make sure that mytab is allocated after the stack and should allow you to compile and link; as for execution, you have to use quite a big ST7 derivative for this to work. Regards, Luca (Cosmic)2006-02-22 05:22 AM
Hi Luca,
It run!!!! :D :D Thank you very much :D :D :D Philippe