-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

same experiment for atmega32, on amd64 host.
same results, except that "usart_0.asm" is replaced by "usart.asm".


On 08/13/2013 03:21 PM, Mark Malmros wrote:
> Assembling Amforth5.0 for an Atmega328P using the Raspberry Pi avra
> instance:
> 
> Untaring  Amforth.5.0.tar.gz, I copied the "Appnotes" directory from
> Studio4 (on my desktop) into the core directory.
> Using template.asm edited for the atmega328p, set  ".equ F_CPU = 16000000"
> (and and commented out the 1wire interface settings and added '.include
> "devices/atmega328p/device.inc"' to the dict_appl.inc file):
> 
> pi@raspberrypi /home/amforth50/appl/template $ sudo avra  -fI  -I
> ../../core -I ../../core/devices/ -I ../../core/Appnotes  template.asm
> 
> Pass 1...
> template.asm(42) : Error   : Found no label/variable/constant named bm_ASYNC
> template.asm(46) : Error   : Found no label/variable/constant named
> bm_ENABLE_TX
> 
> Looking in core/devices/usart_0.asm, both bm_ASYNC and bm_ENABLE_TX are
> there with .equ.
> A simplistic analysis suggests that there is an issue with forward
> referencing with avra that avrasm.exe or Studio4 doesn't have.  Thinking
> that the .include order is important, I simply moved
> 
> .include "drivers/usart_0.asm"
> 
> just above
> 
> .set WANT_ISR_RX = 1 ; interrupt driven receive
> .set WANT_ISR_TX = 0 ; send slowly but with less code space
> 
> in my template file and re-assembled with avra...
> 
> Pass 1...
> Pass 2...
> ../../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
> 
> Assembly complete with no errors (2 warnings).
> Segment usage:
>    Code      :      4223 words (8446 bytes)
>    Data      :       221 bytes
>    EEPROM    :        82 bytes
> 
> 
> The resulting template.hex and template.eep.hex ( > template.eep) were
> flashed on to a Atmega328P using avrdude.  The terminal prompt came up!  I
> loaded atmega328p.frt and a simple stepper motor program and it ran.
> 

I compared the hexfiles created via wine+avrasm2 and avra. template.eep.hex
files are identical. template.hex files are different in 2 bytes only:

$ diff -wu 1_avrasm2_template.hex template.hex 
- --- 1_avrasm2_template.hex    2013-08-13 20:34:45.795745430 +0200
+++ template.hex        2013-08-13 20:36:38.354121499 +0200
@@ -20,7 +20,7 @@
 :02004C000BD0D7
 :1000500009D00008000400701500080041546D65C7
 :04006000676133326F
- -:040000000C94E50572
+:02000000E4C555
 :100064000A920FB60A920F900F900A9400926000C1
 :1000740009900FBE09906894089505FF665F637048
 :10008400750000000A38413800C04138A8002438FF

Turns out this is the PFA_COLD jump (look in .lst files)

wine+avrasm2:
- -----------------------------------------------------
                 .set pc_ = pc
                 .org $0000
000000 940c 05e5   jmp_ PFA_COLD
                 .org pc_
                 .include "drivers/generic-isr.asm"
- -----------------------------------------------------
avra:
- -----------------------------------------------------
          .set pc_ = pc
          .org $0000
C:000000   +    jmp_ PFA_COLD
         

          .ifdef PFA_COLD
          .if (PFA_COLD-pc > 2040) || (pc-PFA_COLD>2040)
C:000000 c5e4      rjmp PFA_COLD
          .endif
          .else
          .org pc_
- -----------------------------------------------------

Seems like avra expands jmp_ to rjmp, whereas avrasm2 does it differently.
The controller talks to me in both cases, so this is not a significant
difference --- cold is executed in any case.

Cheers,
Erich




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBAgAGBQJSCoJwAAoJEHx024vXVRNQcNUP/3ZYj519+fPO6E96XsSXVO0H
A/C00r9YvkgVt6PJ1sOJKF3+yhbQmUo01rwtd0Rdrsml0PYN46GILbNr3VvbZY/S
4FGaLgNuaOXBVLC0E3tp3d0PP6l72PUlx4Ysvey+3v5IbSR9ZqQ2pTW5Fpg2Stai
vkx/rYOcSI0Cp49NL4oDCpJ658GUCc0hlwjUaSEnyUu5tDlHZPyjMzsR+ql+K+F+
D+7oU6QY+dy8HSWCntUvg8qOz/f+eUUc1W3d11Nqgg1Nt1PhKeD40XZpc8mGDBYc
i7iW/vz2hRggYuPTzohVKgTpTXXDGWs/JSiu8jx4LWBukH6qPMoKSIKDodMKFb2Q
Dyjt49BVzVrGmAnQ4K1xpLCzXkIplTKk6T3dfqjYQCqXy0nXNTN46D2BLac8XHOS
AX9WSP7kcATxR68KDeCJzKTFJpFn20ZRhp4EIF73SpC5tvxud/0l4X8KfrDkdGf0
6E4R3c3bnPkBxAzwmkWTztj2wN0LV/ZEjOmDlAIENpgJ8iQMMjhQEeColAzNUnfN
gpQ4BwjiKwTqdTissZuybWVBfb82jORWdCpWt/NHabZNbMzFJgujVMLRWDjSKGvA
sObpnmBDQEbIG3Y0pUuQQUuN5Z/+I5QqBU0bix9H9Bhk8p10P3ccazegFAfrzS59
E7+6QamNcEr/znx3eF+C
=kfG+
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to