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 > > > > > > > > > > > |