From: pito <pi...@vo...> - 2010-09-18 11:20:30
|
Hi, this is a Q I'am carrying with me for a long time and therefore I would kindly ask you following: 1. there is a lot of various dict_x.inc. From time to time I have to add something somewhere. To be honest, I am not sure what I am doing, as I put required .asm simply into dict_appl.inc somewhere.. 2. I saw some short description in the guide, but forget everything 3. Is there any hint or the way HOW to put everything into one BIG dict_big.inc, so I simple compile absolutely everything I may found in \core\words.. and maybe on other places? My atmega is soooo big, so I do not care about the space for at least 3 months.. Thanks, Pito |
From: Matthias T. <mt...@we...> - 2010-09-18 11:57:59
|
Pito, > Hi, > this is a Q I'am carrying with me for a long time and therefore I > would kindly ask you following: > 1. there is a lot of various dict_x.inc. From time to time I have to > add something somewhere. To be honest, I am not sure what I am > doing, as I put required .asm simply into dict_appl.inc somewhere.. Its ok. You can include include files as well. > 2. I saw some short description in the guide, but forget everything Well. > 3. Is there any hint or the way HOW to put everything into one BIG > dict_big.inc, so I simple compile absolutely everything I may found > in \core\words.. and maybe on other places? well. Your text editor program works? And can do copy/paste? Or maybe something like "copy dict_a + dict_b dict_big" (or similiar). I dont know whether the assembler(s) understand the "include *.asm" instruction. probably not. Matthias |
From: pito <pi...@vo...> - 2010-09-18 18:41:15
|
Your text editor program works? And can do > copy/paste? I will investigate a little bit whether my editor knows cut and paste.. (;-)). So maybe I have precise my Q: 1.Does it matter in which order I will copy all possible *.asm files into the one include directory dict_big.inc? 2. No dependencies at all? 3. No special order required (except alfabetical order of words)? 4. Simple merge into one dict_big.inc as I want and do compile ? Thanks, P. |
From: Kalus M. <mic...@on...> - 2010-09-18 22:51:23
|
Pito. > dict_appl.inc ... This is my experience. a) For a well defined board like butterfly and a limited project I put all my *.asm files in the words dictionary of its appl folder, e.g.: amforth-4.1/appl/avr-butterfly/words/*.asm And dict_appl.inc includes all these *.asm files then. So they are added on top of amforths core and options. b) I have a project where 6 small boards of same type but with different assignment of tasks. Such a board has an atmega168 and 4 triacs to switch 220V devices, 4 temperature sensor inputs, and 3 leds. They run at different speeds (8MHz, 12Mhz, 20Mhz) for historical reasons. Some are older, some where added later. This zoo got messed up while I was developing it the a) way. So now I try this order: - changes in amforth core which are the same for all devices stay in amforth-x.x/core/words They are included by amforth.asm as usual. - Extensions of amforth used in all devices go to amforth-x.x/appl/<project>/words They are included running <project-x.asm> which includes amforth.asm that includes dict_appl.inc then, where all words of general use are included. So this is just the same as encouraged by the appl template in amforth. - specific tasks for a device go to amforth-x.x/appl/<project>/<task-x>/words Now <project-x.asm> finaly - after having included amforth.asm - includes all specific task words by including one <task-x.inc>. This <task-x.inc> then includes all the words in ../<task-x>/words. So I hope things work out now this way. :) Michael Am 18.09.2010 um 13:20 schrieb pito: > Hi, > this is a Q I'am carrying with me for a long time and therefore I > would kindly ask you following: > 1. there is a lot of various dict_x.inc. From time to time I have to > add something somewhere. To be honest, I am not sure what I am > doing, as I put required .asm simply into dict_appl.inc somewhere.. > 2. I saw some short description in the guide, but forget everything > 3. Is there any hint or the way HOW to put everything into one BIG > dict_big.inc, so I simple compile absolutely everything I may found > in \core\words.. and maybe on other places? My atmega is soooo big, > so I do not care about the space for at least 3 months.. > Thanks, > Pito > > > ---------------------------------------------------------------------- > -------- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Kalus M. <mic...@on...> - 2010-09-19 09:39:58
|
Hi Pito. Am 19.09.2010 um 02:11 schrieb pito: .. > As Matthias indicates there are > no dependencies on positioning of the asm within the chip (?), .. i! had to be in boot flash section. Interrupt vectors had to be at the _beginning_ of application flash section (or boot flash section; depending on fuse setting). Is that still true for 1284p? All other amforth words are independent and may be compiled in any order you like - theoreticaly. ;-) On atmega168 and other smaler micros quite a few words resided in boot flash section too, and where coded with NEAR relativ jumps (amforth3.6). Those could reach a range of (PC-(2K+1)) to (PC+2K) cells. Some of them addressed i! so they had to stay in boot section flash. And some of them adressed the inner interpreter this way, so they had to be near NEXT, which was in boot sector too. If you put those words some where else, your assembler (AVRA?) will stop with an error message. Thats why there was no simple way to make a bootloader independent of amforth (Arduinos). See amforth-3.6: dict_appl_core.inc dict_core.inc "; this part of the dictionay has to fit into the nrww flash ; section together with the forth inner interpreter." Words of these two files had to stay where they where supposed to be. Now lets see if this is still true with amforth-4.1.? You may grep rjmp instructions in the amforth tree to find out this kind of dependencies. I found: PowerBook:~/amforth/amforthQuellen/amforth-4.1 michael$ grep -i -R rjmp core/*.* appl/*.* appl/atmega2561/*.* appl/atxmega/*.* core/amforth-low.asm: rjmp DO_NEXT core/amforth-low.asm: rjmp DO_EXECUTE core/amforth.asm: rjmp DO_NEXT core/amforth.asm: rjmp DO_EXECUTE PowerBook:~/amforth/amforthQuellen/amforth-4.1 michael$ In both files rjmp is inside of inner interpreter. If you load this or that file depends on you configuration. Looks like there are no such dependencies any more in all other words. Michael |
From: pito <pi...@vo...> - 2010-09-19 10:28:01
|
Michael, thanks! So there are dependencies.. Provided the xx.asm files contains an .org or something like that the dict_ file must not be organised specificly, maybe.. E.g. first idea: ########## do not touch >>>>>>>>>>>> dict_core.inc dict_appl_core.inc ########## <<<<<< do not touch ##### above .incs are called by amforth.asm!! "dict_big.inc" (following xx.inc means the content of it,cleaned,merged): ******************* dict_mcu.inc dict compiler.inc dict_usart.inc dict_vm.inc dict_wl.inc user.inc device.inc (? not needed??, why it does exist? why it defines words as variables when those are constants (various reg addr)? - I am not setting "WANT_" but loading atmega1284p.frt instead, thus this frt would be fine to have in asm...) words\*.asm ******************* Not sure about device.inc. Why we need it? Pito |
From: Matthias T. <mt...@we...> - 2010-09-19 12:59:54
|
Pito, > E.g. first idea: > ########## do not touch >>>>>>>>>>>> > dict_core.inc > dict_appl_core.inc > ########## <<<<<< do not touch ##### > above .incs are called by amforth.asm!! And those files are from the appl/<whatever>/ directory. amforth does not provide them. Its up to the developer to fill them with useful content. Not more, not less. > device.inc (? not needed??, why it does exist? Its the read-to-use version of the device.frt file. You may define some WANT_ constants and get the definitions at compile/assembly time. > why it defines words > as variables when those are constants (various reg addr)? The registers and IO ports are in fact variables. Most of them 8bit wide. > - I am not > setting "WANT_" but loading atmega1284p.frt instead, No comment > > Not sure about device.inc. Why we need it? You dont have to use it. Matthias |
From: Kalus M. <mic...@on...> - 2010-09-19 13:44:25
|
Hi Pito. .. > Not sure about device.inc. Why we need it? Setup device.asm to include your device.inc tree if you like to have address names at forth level too. No need to download them as forth source code then. e.g. (atmega168): You want all PortB names as forth words. Edit device.asm line 35, set zero to one: .set WANT_PORTB = 1 At amforth level you will find the constants PORTB ( -- adr ) DDRB ( -- adr ) then. Some of us like to load them at forth source level, use <device>.frt to do so. There later on its easier to see what you did if you excluded some. For the assembler they are provided by .nolist .include "m168def.inc" .list in device.asm file, as they are used in assembler level codings. > why it defines words as variables when those are constants? No magic. See DDRB: ; Port B Data Direction Register VE_DDRB: .dw $ff04 .db "DDRB" .dw VE_HEAD .set VE_HEAD=VE_DDRB XT_DDRB: .dw PFA_DOVARIABLE PFA_DDRB: .dw $24 What you want is an address in RAM to use for phrases like 0 DDRB c! PORB c@ .. Since all those avr atmega device registers are mapped intp ram addresses - Ports, timer etc. - you may just treat them as a variable. Give them a name an get the address - its that simple. Thats what a forth variable does. > thus this frt would be fine to have in asm. Thats exactly what the device.asm does. Maybe you want them all since you have plenty of flash space, so simply turn all WANTs on. Michael Am 19.09.2010 um 12:27 schrieb pito: > Michael, thanks! So there are dependencies.. > Provided the xx.asm files contains an .org or something like that > the dict_ file must not be organised specificly, maybe.. > > E.g. first idea: > ########## do not touch >>>>>>>>>>>> > dict_core.inc > dict_appl_core.inc > ########## <<<<<< do not touch ##### > above .incs are called by amforth.asm!! > > "dict_big.inc" (following xx.inc means the content of > it,cleaned,merged): > ******************* > dict_mcu.inc > dict compiler.inc > dict_usart.inc > dict_vm.inc > dict_wl.inc > user.inc > device.inc (? not needed??, why it does exist? why it defines words > as variables when those are constants (various reg addr)? - I am not > setting "WANT_" but loading atmega1284p.frt instead, thus this frt > would be fine to have in asm...) > words\*.asm > ******************* > > Not sure about device.inc. Why we need it? > > Pito > > > > > > > > > > > |
From: pito <pi...@vo...> - 2010-09-19 17:17:02
|
> Some of us like to load them at forth source > level, use <device>.frt > to do so. But: 116 regs in device.inc <> 153 in device.frt (for 1284p) > > why it defines words as variables when those are > > constants? Ahaa so: ; ( -- addr ) System Constant ; R( -- ) ; ADC Data Register High Byte VE_ADCH: .dw $ff04 .db "ADCH" .dw VE_HEAD .set VE_HEAD=VE_ADCH XT_ADCH: .dw PFA_DOVARIABLE PFA_ADCH: .dw $79 is equal to this definition as well: 79 constant ADCH \ ADC Data Register High Byte For me ADCH is constant which contains the address of the register. That is the trick.. Thanks, Pito |
From: pito <pi...@vo...> - 2010-09-19 18:04:22
|
Matthias, dict_appl_core.inc contains: .include "dict_core.inc" .include "words/estore.asm" .include "words/efetch.asm" .include "words/istore.asm" .include "words/istore_nrww.asm" .include "words/ifetch.asm" This seems to be critical words.. and dict_core.inc contains: ; this part of the dictionay has to fit into the nrww flash ; section together with the forth inner interpreter .include "words/int-on.asm" .include "words/int-off.asm" .include "words/int-restore.asm" .include "words/exit.asm" .include "words/execute.asm" .include "words/dobranch.asm" .include "words/docondbranch.asm" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + lot of other words............... ............... Q: the above requirement "this part of the .." is valid for the whole content of dict_core.inc or it is valid only for the first ";;;;;;;;;;;;;;" so the first 7 words? All except the first 7 words is up to the user how it is defined? Q: could be that "+ lot of other words" replaced by the whole \words\*.asm for example (in an inteligent way of course)? The dict_appl.inc is then basically empty and the user can put there e.g. his new words.. P. |
From: pito <pi...@vo...> - 2010-09-19 18:21:26
|
Just an idea pls: we will have only 3 dict_: dict_core.inc will contain (critical): .include "words/int-on.asm" .include "words/int-off.asm" .include "words/int-restore.asm" .include "words/exit.asm" .include "words/execute.asm" .include "words/dobranch.asm" .include "words/docondbranch.asm" .include "words/estore.asm" .include "words/efetch.asm" .include "words/istore.asm" .include "words/istore_nrww.asm" .include "words/ifetch.asm" dict_appl_core.inc will contain: all release words\*.asm (or subset for smaller chips) plus other .asm from release (currently other dict_x) dict_appl.inc will contain: free - .asm as you want Pito. ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: mt...@we..., amf...@li... Předmět: Re: [Amforth-devel] How TO - dict_x for bigger atmegas Datum: 19.9.2010 - 20:04:14 > Matthias, > > dict_appl_core.inc contains: > > .include "dict_core.inc" > .include "words/estore.asm" > .include "words/efetch.asm" > > .include "words/istore.asm" > .include "words/istore_nrww.asm" > .include "words/ifetch.asm" > > This seems to be critical words.. > > and dict_core.inc contains: > > ; this part of the dictionay has to fit into the > nrww flash > ; section together with the forth inner > interpreter > .include "words/int-on.asm" > .include "words/int-off.asm" > .include "words/int-restore.asm" > > .include "words/exit.asm" > .include "words/execute.asm" > .include "words/dobranch.asm" > .include "words/docondbranch.asm" > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > + lot of other words............... > ............... > > > Q: the above requirement "this part of the .." is > valid for the > whole content of dict_core.inc or it is valid only > for the first > ";;;;;;;;;;;;;;" so the first 7 words? All except > the first 7 words > is up to the user how it is defined? > Q: could be that "+ lot of other words" replaced > by the whole > \words\*.asm for example (in an inteligent way of > course)? > > The dict_appl.inc is then basically empty and the > user can put there > e.g. his new words.. > P. > > > > > ------------------------------------------------------------------------------ > > Start uncovering the many advantages of virtual > appliances > and start using them to simplify application > deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |