From: Hannu V. <vu...@ms...> - 2012-08-02 03:59:36
|
Hello everybody! I once compiled succesfully Amforth 4.5 and have been used it for a until last week. My MCU changed from ATMega 328 to ATMega128. Now I need to build Amforth for that and I can't get it done. I've copied from program files/Atmel/AVR Tools/avrAssembler/Appnotes to amforth's root as Atmel/Appnotes2 copied template to my_project_amforth and chaged MCU and assembler from makefile. From template.asm I've changed the clockspeed to right. I'm getting this out of make: $ make avra -I ../../Atmel/Appnotes2 -I ../../core -I ../../core/devices/atmega128 --listmac -l template.lst -m template.map template.asm AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) Copyright (C) 1998-2010. Check out README file for more info AVRA is an open source assembler for Atmel AVR microcontroller family It can be used as a replacement of 'AVRASM32.EXE' the original assembler shipped with AVR Studio. We do not guarantee full compatibility for avra. AVRA comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of avra under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING. Pass 1... ../../core/devices/atmega128/device.asm(52) : Error : Unknown directive: .OVERLAP ../../core/devices/atmega128/device.asm(122) : Error : Unknown directive: .NOOVERLAP template.asm(34) : Error : Found no label/variable/constant named bm_ASYNC template.asm(38) : Error : Found no label/variable/constant named bm_ENABLE_TX ../../core/words/cold.asm(12) : Error : [Macro: ../../core/macros.asm: 51:] Found no label/variable/constant named MCUSR ../../core/words/cold.asm(16) : Error : [Macro: ../../core/macros.asm: 59:] Found no label/variable/constant named MCUSR ../../core/amforth.asm(18) : Error : Found no label/variable/constant named NRWW_START_ADDR ../../core/amforth-eeprom.inc(56) : Error : .BYTE directive can only be used in data segment (.DSEG) Error: Overlapping Code-segments : Start = 0x0004, End = 0x0004, Length = 0x0001 Start = 0x0004, End = 0x03C6, Length = 0x03C3 Please check your .ORG directives ! Error: Overlapping Code-segments : Start = 0x0006, End = 0x0006, Length = 0x0001 Start = 0x0004, End = 0x03C6, Length = 0x03C3 Please check your .ORG directives ! Error: Overlapping Code-segments : Start = 0x0008, End = 0x0008, Length = 0x0001 Start = 0x0004, End = 0x03C6, Length = 0x03C3 Please check your .ORG directives ! Error: Overlapping Code-segments : Start = 0x000A, End = 0x000A, Length = 0x0001 Start = 0x0004, End = 0x03C6, Length = 0x03C3 Please check your .ORG directives ! <<SNIP>> make: *** [template.hex] Error 1 Now. What did I do wrong? Except been using Linux as desktop,,, I've tried to read amforth.pdf and follow those instructions but please someone point out my mistake. Best Regards, Hannu Vuolasaho |
From: Erich W. <ew....@na...> - 2012-08-02 16:48:55
|
Hello Hannu, I just checked: + avra built from git: 21f54ca HEAD@{0}: pull : Fast-forward cf495f3 HEAD@{1}: clone: from git://avra.git.sourceforge.net/gitroot/avra/avra + I can compile amforth-4.2 for atmega32 + I can compile amforth-4.5 for atmega32 as well I have not checked whether they actually work. + I can compile amforth-4.6 for atmega32 --- but it doesn't work! The same files compiled with wine+avrasm2 do work. I sort of remember, that avra failed on me before with amforth 4.6. I have never gotten around to find the commit in amforth, which made avra choke. So: a. what version of avra are you using? Maybe you have a long forgotten version from the git repo somewhere but not in PATH? b. Are you still using amforth 4.5? If so, c. can you still compile for the 328? Maybe this narrows down the possible causes. Hopefully someone else has more experience with the atmega128. Cheers, Erich On 08/02/2012 05:59 AM, Hannu Vuolasaho wrote: > > Hello everybody! > > I once compiled succesfully Amforth 4.5 and have been used it for a until last week. My MCU changed from ATMega 328 to ATMega128. > > Now I need to build Amforth for that and I can't get it done. I've copied from program files/Atmel/AVR Tools/avrAssembler/Appnotes to amforth's root as Atmel/Appnotes2 copied template to > my_project_amforth and chaged MCU and assembler from makefile. From template.asm I've changed the clockspeed to right. > > I'm getting this out of make: > > $ make > avra -I ../../Atmel/Appnotes2 -I ../../core -I ../../core/devices/atmega128 --listmac -l template.lst -m template.map template.asm > AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) > Copyright (C) 1998-2010. Check out README file for more info > > AVRA is an open source assembler for Atmel AVR microcontroller family > It can be used as a replacement of 'AVRASM32.EXE' the original assembler > shipped with AVR Studio. We do not guarantee full compatibility for avra. > > AVRA comes with NO WARRANTY, to the extent permitted by law. > You may redistribute copies of avra under the terms > of the GNU General Public License. > For more information about these matters, see the files named COPYING. > > Pass 1... > ../../core/devices/atmega128/device.asm(52) : Error : Unknown directive: .OVERLAP > ../../core/devices/atmega128/device.asm(122) : Error : Unknown directive: .NOOVERLAP > template.asm(34) : Error : Found no label/variable/constant named bm_ASYNC > template.asm(38) : Error : Found no label/variable/constant named bm_ENABLE_TX > ../../core/words/cold.asm(12) : Error : [Macro: ../../core/macros.asm: 51:] Found no label/variable/constant named MCUSR > ../../core/words/cold.asm(16) : Error : [Macro: ../../core/macros.asm: 59:] Found no label/variable/constant named MCUSR > ../../core/amforth.asm(18) : Error : Found no label/variable/constant named NRWW_START_ADDR > ../../core/amforth-eeprom.inc(56) : Error : .BYTE directive can only be used in data segment (.DSEG) > Error: Overlapping Code-segments : > Start = 0x0004, End = 0x0004, Length = 0x0001 > Start = 0x0004, End = 0x03C6, Length = 0x03C3 > Please check your .ORG directives ! > Error: Overlapping Code-segments : > Start = 0x0006, End = 0x0006, Length = 0x0001 > Start = 0x0004, End = 0x03C6, Length = 0x03C3 > Please check your .ORG directives ! > Error: Overlapping Code-segments : > Start = 0x0008, End = 0x0008, Length = 0x0001 > Start = 0x0004, End = 0x03C6, Length = 0x03C3 > Please check your .ORG directives ! > Error: Overlapping Code-segments : > Start = 0x000A, End = 0x000A, Length = 0x0001 > Start = 0x0004, End = 0x03C6, Length = 0x03C3 > Please check your .ORG directives ! > <<SNIP>> > make: *** [template.hex] Error 1 > > Now. What did I do wrong? Except been using Linux as desktop,,, I've tried to read amforth.pdf and follow those instructions but please someone point out my mistake. > > Best Regards, > Hannu Vuolasaho > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Hannu V. <vu...@ms...> - 2012-08-03 09:16:45
|
Sorry. Maybe I wasn't quite clear. Im building Amforth 4.9 $ avra --version AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) I think I'm getting on with this. problems with .overlap org errors required git version of Avra. http://permalink.gmane.org/gmane.comp.lang.forth.amforth/1047 instructed to add one .equ MCUSR = MCUCSR line. bm_PARITY problem was solved changing order of serial setting and driver. I also had wrong appnotes :( After I copied from avrassembler2 appnotes, amfort compiled. However binary doesn't work :( Anyway I was able to compile and flash in AVRstudio. With avra I still have these warnings: ../../core/words/brackettick.asm(6) : Warning : A .DB segment with an odd number of bytes is detected. A zero byte is added. ../../core/words/tick.asm(6) : Warning : A .DB segment with an odd number of bytes is detected. A zero byte is added. done To get everything working some investigation should be done. However ATmega128 is quite old controller and no-one uses it. (except me) Best regards, Hannu Vuolasaho ---------------------------------------- > Date: Thu, 2 Aug 2012 18:48:40 +0200 > From: ew....@na... > To: amf...@li... > Subject: Re: [Amforth] Compiling Amforth 4.9 > > Hello Hannu, > > I just checked: > + avra built from git: > 21f54ca HEAD@{0}: pull : Fast-forward > cf495f3 HEAD@{1}: clone: from > git://avra.git.sourceforge.net/gitroot/avra/avra > > + I can compile amforth-4.2 for atmega32 > + I can compile amforth-4.5 for atmega32 as well > I have not checked whether they actually work. > + I can compile amforth-4.6 for atmega32 --- but it doesn't > work! The same files compiled with wine+avrasm2 do work. I sort > of remember, that avra failed on me before with amforth 4.6. I > have never gotten around to find the commit in amforth, which > made avra choke. > > So: > a. what version of avra are you using? Maybe you have a long > forgotten version from the git repo somewhere but not in PATH? > b. Are you still using amforth 4.5? If so, > c. can you still compile for the 328? > Maybe this narrows down the possible causes. Hopefully someone > else has more experience with the atmega128. > > Cheers, > Erich > > On 08/02/2012 05:59 AM, Hannu Vuolasaho wrote: >> >> Hello everybody! >> >> I once compiled succesfully Amforth 4.5 and have been used it for a until last week. My MCU changed from ATMega 328 to ATMega128. >> >> Now I need to build Amforth for that and I can't get it done. I've copied from program files/Atmel/AVR Tools/avrAssembler/Appnotes to amforth's root as Atmel/Appnotes2 copied template to >> my_project_amforth and chaged MCU and assembler from makefile. From template.asm I've changed the clockspeed to right. >> >> I'm getting this out of make: >> >> $ make >> avra -I ../../Atmel/Appnotes2 -I ../../core -I ../../core/devices/atmega128 --listmac -l template.lst -m template.map template.asm >> AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) >> Copyright (C) 1998-2010. Check out README file for more info >> >> AVRA is an open source assembler for Atmel AVR microcontroller family >> It can be used as a replacement of 'AVRASM32.EXE' the original assembler >> shipped with AVR Studio. We do not guarantee full compatibility for avra. >> >> AVRA comes with NO WARRANTY, to the extent permitted by law. >> You may redistribute copies of avra under the terms >> of the GNU General Public License. >> For more information about these matters, see the files named COPYING. >> >> Pass 1... >> ../../core/devices/atmega128/device.asm(52) : Error : Unknown directive: .OVERLAP >> ../../core/devices/atmega128/device.asm(122) : Error : Unknown directive: .NOOVERLAP >> template.asm(34) : Error : Found no label/variable/constant named bm_ASYNC >> template.asm(38) : Error : Found no label/variable/constant named bm_ENABLE_TX >> ../../core/words/cold.asm(12) : Error : [Macro: ../../core/macros.asm: 51:] Found no label/variable/constant named MCUSR >> ../../core/words/cold.asm(16) : Error : [Macro: ../../core/macros.asm: 59:] Found no label/variable/constant named MCUSR >> ../../core/amforth.asm(18) : Error : Found no label/variable/constant named NRWW_START_ADDR >> ../../core/amforth-eeprom.inc(56) : Error : .BYTE directive can only be used in data segment (.DSEG) >> Error: Overlapping Code-segments : >> Start = 0x0004, End = 0x0004, Length = 0x0001 >> Start = 0x0004, End = 0x03C6, Length = 0x03C3 >> Please check your .ORG directives ! >> Error: Overlapping Code-segments : >> Start = 0x0006, End = 0x0006, Length = 0x0001 >> Start = 0x0004, End = 0x03C6, Length = 0x03C3 >> Please check your .ORG directives ! >> Error: Overlapping Code-segments : >> Start = 0x0008, End = 0x0008, Length = 0x0001 >> Start = 0x0004, End = 0x03C6, Length = 0x03C3 >> Please check your .ORG directives ! >> Error: Overlapping Code-segments : >> Start = 0x000A, End = 0x000A, Length = 0x0001 >> Start = 0x0004, End = 0x03C6, Length = 0x03C3 >> Please check your .ORG directives ! >> <<SNIP>> >> make: *** [template.hex] Error 1 >> >> Now. What did I do wrong? Except been using Linux as desktop,,, I've tried to read amforth.pdf and follow those instructions but please someone point out my mistake. >> >> Best Regards, >> Hannu Vuolasaho >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Amforth-devel mailing list for http://amforth.sf.net/ >> Amf...@li... >> https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Marcin C. <sa...@sa...> - 2012-08-10 16:27:33
|
>> Hannu Vuolasaho <vu...@ms...> wrote: > > Sorry. Maybe I wasn't quite clear. Im building Amforth 4.9 > > > $ avra --version > AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) > > I think I'm getting on with this. problems with .overlap org errors required git version of Avra. > > http://permalink.gmane.org/gmane.comp.lang.forth.amforth/1047 instructed to add one .equ MCUSR = MCUCSR line. > bm_PARITY problem was solved changing order of serial setting and driver. > > I also had wrong appnotes :( After I copied from avrassembler2 appnotes, amfort compiled. > > However binary doesn't work :( Can you generate a list file (-l listfile) and also send me resulting .hex files? I would like also to try it here - what should I set up in my environment? Did you succeed using avrasm2? can you send me resulting hex files and the listfile as well? By the way: the newest git master from avra finally supports -o, -e and -d options to change the flash output, EEPROM, and debug file names. Finally! //Marcin |
From: Hannu V. <vu...@ms...> - 2012-08-18 18:39:02
|
Hi! Sorry about long delay. I was out of net for a while. Here are two files. They are the successing windows build from appl directory (my_forth.zip) and same thing from Linux and Avra (from_linux.tar.gz) Hopefully these have some help making Amforth better. Best regards, Hannu Vuolasaho ---------------------------------------- > To: amf...@li... > From: sa...@sa... > Date: Fri, 10 Aug 2012 16:27:09 +0000 > Subject: Re: [Amforth] Compiling Amforth 4.9 > > >> Hannu Vuolasaho <vu...@ms...> wrote: > > > > Sorry. Maybe I wasn't quite clear. Im building Amforth 4.9 > > > > > > $ avra --version > > AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010) > > > > I think I'm getting on with this. problems with .overlap org errors required git version of Avra. > > > > http://permalink.gmane.org/gmane.comp.lang.forth.amforth/1047 instructed to add one .equ MCUSR = MCUCSR line. > > bm_PARITY problem was solved changing order of serial setting and driver. > > > > I also had wrong appnotes :( After I copied from avrassembler2 appnotes, amfort compiled. > > > > However binary doesn't work :( > > Can you generate a list file (-l listfile) and also send me resulting .hex files? > > I would like also to try it here - what should I set up in my environment? > > Did you succeed using avrasm2? can you send me resulting hex files and the listfile > as well? > > By the way: the newest git master from avra finally supports -o, -e and -d options > to change the flash output, EEPROM, and debug file names. Finally! > > //Marcin > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Marcin C. <sa...@sa...> - 2012-08-18 02:10:48
|
On Fri, 17 Aug 2012, Erich Waelde wrote: > Hello Marcin, > > I have made tests > 1. compile avra from git > commit a6e8b2957953810dae6467eeb4905bfc5ea6c33e > Author: Marcin Cieslak <sa...@sa...> > Date: Wed Aug 8 17:01:30 2012 +0200 > Does this help? Yes, thank you. It seems the problem described in this thread: http://thread.gmane.org/gmane.comp.lang.forth.amforth/1353/focus=1354 is related to calculation of forward referenced labels in a macro. Consider the following code (correctly assembled): .device atmega32 PFA_COLD: C:000000 c004 rjmp PFA_DOPLUSLOOP3 C:000001 0000 nop C:000002 0000 nop C:000003 0000 nop C:000004 0000 nop PFA_DOPLUSLOOP3: C:000005 9508 ret Used memory blocks: code : Start = 0x0000, End = 0x0005, Length = 0x0006 (6 words), Overlap=N Segment usage: Code : 6 words (12 bytes) Data : 0 bytes EEPROM : 0 bytes But this: .device atmega32 .macro jmp_ ; a more flexible macro .ifdef @0 .if (@0-pc > 2040) || (pc-@0>2040) jmp @0 .else rjmp @0 .endif .else jmp @0 .endif .endmacro PFA_COLD: C:000000 + jmp_ PFA_DOPLUSLOOP3 .ifdef PFA_DOPLUSLOOP3 .if (PFA_DOPLUSLOOP3-pc > 2040) || (pc-PFA_DOPLUSLOOP3>2040) :000000 c005 rjmp PFA_DOPLUSLOOP3 .endif .else C:000001 0000 nop C:000002 0000 nop C:000003 0000 nop C:000004 0000 nop PFA_DOPLUSLOOP3: C:000005 9508 ret Used memory blocks: code : Start = 0x0000, End = 0x0006, Length = 0x0007 (7 words), Overlap=N Segment usage: Code : 7 words (14 bytes) Data : 0 bytes EEPROM : 0 bytes Assembly completed with no errors. Generated jump goes one word too far (it is "jump 5 words forward" and not "jump 4 words forward"). It can even be seen that the length of a macro expansion is wrongly estimated (it says the whole code is 7 words, while it is only 6). avrasm2 generally does not allow using not-yet-defind labels in macros like this. There are two forward jumps in the code of amforth: 1. There is no problem with "jmp_ PFA_COLD" since the distance to PFA_COLD does to depend on the size of the macro expanded. 2. Only "jmp_ PFA_DOPLUSLOOP3" is problematic since the label address depends on the size of the macro - and this can change .. depending on the target address of the label. Amforth 4.4 works because it had "rjmp PFA_DOPLUSLOOP3" hardcoded and not jmp_ macro. So there are two workarounds for amforth: 1) revert to amforth 4.4 hardcoded "rjmp" since we can assume the distance is pretty small here. 2) add a nop after "rjmp" in the "jmp_" macro to keep sizes of the macro expansion constant. Solutions: 1) AVRA may disallow forward refences in the macros. 2) Detecting the impossibility to determine the value. 3) ... //Marcin |
From: Matthias T. <mt...@we...> - 2012-08-18 08:12:51
|
Hi, > Generated jump goes one word too far (it is "jump 5 words forward" > and not "jump 4 words forward"). It can even be seen > that the length of a macro expansion is wrongly estimated > (it says the whole code is 7 words, while it is only 6). > > avrasm2 generally does not allow using not-yet-defind > labels in macros like this. really? I doubt it. > > So there are two workarounds for amforth: > > 1) revert to amforth 4.4 hardcoded "rjmp" since we can > assume the distance is pretty small here. > > 2) add a nop after "rjmp" in the "jmp_" macro to keep > sizes of the macro expansion constant. That would contradict one of the 2 intentions of the macro: size savings (the other one is speed). > > > Solutions: > > 1) AVRA may disallow forward refences in the macros. > > 2) Detecting the impossibility to determine > the value. > > 3) ... 3) get an smart jump instruction. I vote for 3) ;) Does the patch diff --git a/core/dict_core.inc b/core/dict_core.inc index b7ddeb1..d88f9f6 100644 --- a/core/dict_core.inc +++ b/core/dict_core.inc @@ -74,8 +74,8 @@ .include "words/dodo.asm" .include "words/doqdo.asm" .include "words/i.asm" -.include "words/doloop.asm" .include "words/doplusloop.asm" +.include "words/doloop.asm" .include "words/unloop.asm" help? Does the quick fix from workaround 1) give a working system? Matthias |
From: Erich W. <ew....@na...> - 2012-08-18 15:58:06
|
Hello, On 08/18/2012 10:12 AM, Matthias Trute wrote: > Does the patch > > diff --git a/core/dict_core.inc b/core/dict_core.inc > index b7ddeb1..d88f9f6 100644 > --- a/core/dict_core.inc > +++ b/core/dict_core.inc > @@ -74,8 +74,8 @@ > .include "words/dodo.asm" > .include "words/doqdo.asm" > .include "words/i.asm" > -.include "words/doloop.asm" > .include "words/doplusloop.asm" > +.include "words/doloop.asm" > .include "words/unloop.asm" > > > help? Yes. avra is then producing a working system. :-) The same observation holds for amforth-4.9! > Does the quick fix from workaround > 1) give a working system? No. see my other reply in thread. If someone needs files, please speak up. Cheers, Erich |
From: Erich W. <ew....@na...> - 2012-08-18 15:37:35
|
Hello, On 08/18/2012 04:10 AM, Marcin Cieslak wrote: > On Fri, 17 Aug 2012, Erich Waelde wrote: >> I have made tests >> 1. compile avra from git >> commit a6e8b2957953810dae6467eeb4905bfc5ea6c33e >> Author: Marcin Cieslak<sa...@sa...> >> Date: Wed Aug 8 17:01:30 2012 +0200 > <schnipp> > > Generated jump goes one word too far (it is "jump 5 words forward" > and not "jump 4 words forward"). It can even be seen > that the length of a macro expansion is wrongly estimated > (it says the whole code is 7 words, while it is only 6). > > avrasm2 generally does not allow using not-yet-defind > labels in macros like this. > > There are two forward jumps in the code of amforth: > > 1. There is no problem with "jmp_ PFA_COLD" since the > distance to PFA_COLD does to depend on the size of the > macro expanded. > > 2. Only "jmp_ PFA_DOPLUSLOOP3" is problematic since the label > address depends on the size of the macro - and this can > change .. depending on the target address of the label. > > Amforth 4.4 works because it had "rjmp PFA_DOPLUSLOOP3" > hardcoded and not jmp_ macro. > > > So there are two workarounds for amforth: > > 1) revert to amforth 4.4 hardcoded "rjmp" since we can > assume the distance is pretty small here. I have included doplusloop.asm from amforth-4.4 into the build from amforth-4.5, and verified the difference in source. Result: amforth built with avrasm2 works, whereas amforth built with avra fails to connect via serial interface. So, while the above observation may still hold, it seems not to be the only problem. Since I would really appreciate avra being able to build amforth, is there anything else I can do? > > 2) add a nop after "rjmp" in the "jmp_" macro to keep > sizes of the macro expansion constant. > > > Solutions: > > 1) AVRA may disallow forward refences in the macros. > > 2) Detecting the impossibility to determine > the value. > > 3) ... > > //Marcin Cheers, Erich |
From: Marcin C. <sa...@sa...> - 2012-08-18 19:53:12
|
On Sat, 18 Aug 2012, Erich Waelde wrote: > > 1) revert to amforth 4.4 hardcoded "rjmp" since we can > > assume the distance is pretty small here. > > I have included doplusloop.asm from amforth-4.4 into the build > from amforth-4.5, and verified the difference in source. Result: > amforth built with avrasm2 works, whereas > amforth built with avra fails to connect via serial interface. I think doplusloop.asm has "rjmp" in all recent versions. Can you try this "doloop.asm"? I see that r1071 changed lots of jumps, but most of them (like DO_NEXT) should be fine - they are referring to the already-defined labels. ------------------------------------------------------------------------ r1071 | mtrute | 2011-06-03 18:49:08 +0200 (Fri, 03 Jun 2011) | 1 line use the smart jump instruction everywhere ------------------------------------------------------------------------ //Marcin |
From: Erich W. <ew....@na...> - 2012-08-19 06:28:23
|
Hello Marcin, thanks for your reply. On 08/18/2012 09:53 PM, Marcin Cieslak wrote: > On Sat, 18 Aug 2012, Erich Waelde wrote: > > >>> 1) revert to amforth 4.4 hardcoded "rjmp" since we can >>> assume the distance is pretty small here. >> >> I have included doplusloop.asm from amforth-4.4 into the build >> from amforth-4.5, and verified the difference in source. Result: >> amforth built with avrasm2 works, whereas >> amforth built with avra fails to connect via serial interface. > > I think doplusloop.asm has "rjmp" in all recent versions. > Can you try this "doloop.asm"? Sure. creating a 4.5 system, with the original order of doloop doplusloop unloop in dict_core.inc replacing words/doloop.asm with the file from amforth-4.4 diff -wu releases/4.{4,5}/core/words/doloop.asm --- releases/4.4/core/words/doloop.asm 2011-05-24 20:11:11.207999857 +0200 +++ releases/4.5/core/words/doloop.asm 2011-06-29 20:04:52.754880362 +0200 @@ -17,4 +17,4 @@ cp zl, temp2 cpc zh, temp3 breq PFA_DOPLUSLOOP1 - rjmp PFA_DOPLUSLOOP3 + jmp_ PFA_DOPLUSLOOP3 building amforth with avra creates a working system --- I can talk to it on the serial prompt. :-) > > I see that r1071 changed lots of jumps, but most > of them (like DO_NEXT) should be fine - they are > referring to the already-defined labels. > > ------------------------------------------------------------------------ > r1071 | mtrute | 2011-06-03 18:49:08 +0200 (Fri, 03 Jun 2011) | 1 line > > use the smart jump instruction everywhere > ------------------------------------------------------------------------ > > //Marcin I'm not sure, what to make of the current state of information. So I leave this to the experts. Cheers, Erich |
From: Marcin C. <sa...@sa...> - 2012-08-21 10:45:13
|
>> Matthias Trute <mt...@we...> wrote: > Hi, > >> avrasm2 generally does not allow using not-yet-defind >> labels in macros like this. > > really? I doubt it. To be correct: ifdef returns false for forward references and therefore jmp is assembled by AVRASM2. >> 2) add a nop after "rjmp" in the "jmp_" macro to keep >> sizes of the macro expansion constant. > > That would contradict one of the 2 intentions of > the macro: size savings (the other one is speed). I agree, but... > 3) get an smart jump instruction. ... how do solve the problem: jmp_ A: nop nop A: The final address of A depends on the size of jmp_ expansion, that may be 1 word or 2 words. Size of the jmp_ expansion depends on how for A is. Isn't that a circular reference? //Marcin |
From: Matthias T. <mt...@we...> - 2012-08-21 18:24:43
|
Hi Marcin, >>> avrasm2 generally does not allow using not-yet-defind >>> labels in macros like this. >> >> really? I doubt it. > > To be correct: ifdef returns false for > forward references and therefore jmp is assembled > by AVRASM2. And avra does not the same? A quick test (placing the code of the inner interpreter as the last code ever included) resulted in many jmp's, placing it in front of the many primitives from dict_core.inc gives many rjmp (as is should be). Since the DOLOOP words are the only part of the code that cause the trouble (to my surprise btw) I'll simply swap the ordering in the dict_core file and make a note to myself to never change that again ;) Rev 1273 work Matthias |