Hola Andres: Podrias explicarlo en espa#ol, no porque tu ingles sea malo, sino porque asi te vamos a entender mejor los mas de 6 argentinos de la lista ;-). Pero veamos ... [snip] > TEXT_DISPLAY > | | > --------------- ------------------ > | | > | | > FILLING_A_TEXT_BUFFER------------- READING_A_TEXT_BUFFER > | | | | > | ------------- ------------ | > | | | | > KEYBOARD_INTERFACE SERIAL_INTERFACE EEPROM_SUPPORT Aca parece que no solo tenes un metodo especial para las variables o es una super-simplificacion, supongo que mas bien lo ultimo y que el grafico es explicativo o no? Me refiero a que en realidad mucho de esto labura por interrupciones cuyas rutinas son algo paralelo al esquema. >A critical issue in programming a system like this is the allocation of >variables. By that I mean giving an address to each variable each >component uses. Si es critico cuando te quedas corto con la memoria. >If you use no strategy at all and allocate everything by hand using "EQU"s >you will have to do some work every time you create a new variable. Lets [snip] >and it's a routine that requires none of your creativity. Hey! What do you >have your PC for? >The same scheme can be automatized in several ways. One is what Microchip >suggests with the use of unseeded "CBLOCK"s. With this methods the >assembler will linearly assign addresses to all variables at compile-time. >That solves the problems as long as you don't run out of registers. Supongo que nadie usa definir todo a mano, yo use para las primeras pruebas: #define Primera XXXX var1 equ Primera var2 equ Primera+1 etc Hasta que lei un poco mas la documentacion y encontre CBLOCK. >If you do run out of registers the solution will surely be overlapping >(assigning the same address to) variables that are never "active" at the >same time. That's where the method I'm suggesting comes to play. It is a >way of automatizing this job without sacrifizing any modularity. A mi se me ocurriria usar CBLOCKS solapados, pero si vos tenes una manera de hacerlo automatico aleluya!. >The implementation of the method consists of several macros that give a >high-level-language look to the declaration of variables in your code and >make most of the job for you. >I'll give you just a tip here and I'll continue in other messages. The >question is: What variables can you overlap? Recall the previous graph. >You can't be sure if you can overlap variables belonging to [snip] >and that I'm not discovering America but it took quite a while for me to >sit down, think and develop it, and its conclusions turned out being very >useful to me. Suena interesante. Yo uso mucho maquinas de estado porque me permiten tener procesos en paralelo y abstraerme de la parte de IRQs, asi como testear la maquina de estados en la PC (Uso un generador de maquinas de estado que me hice que genera codigo en assembler de PIC o en ANSI-C). >If I don't receive complaints for using so much of this space I'll >continue later. I will be glad to receive feedback from you. Do you have >any other strategies for doing this? Can you see something wrong in what >I'm saying? Did you think of this too? Si algun boludo te dice algo no le des bola, no se si lees la lista seguido, pero el 70% del tiempo se la pasan boludeando con cuantos dedos tendrian los marcianos y otros temas no mucho mas interesantes, por otro lado cada tanto algun nabo no se da cuenta y manda un atachment a la lista de 100Kb, un flaco de Entre Rios se calento bastante una vez pero lo mejor es ignorarlos cuando se ponen a taradear. Saludos SET. P.D. Que haces con una cuenta en Filosofia, es de tu hermano/a? ******************************************************************************** Salvador Eduardo Tropea (SET) - salvador@inti.edu.ar Work: INTI (National Institute of Industrial Technology) Sector: ICE (Electronic Control & Instrumentation) Post (Home): Curapaligue 2124 - Caseros (1678)- Buenos Aires - Argentina