From: Erich W. <ew....@na...> - 2011-07-26 17:38:33
|
Hello Paolo, On 07/26/2011 03:10 PM, pao...@fa... wrote: > Hello guys, > I'm trying to build amforth for an ATmega128. > It won't compile, searching for a definition of MCUSR. > Attached you'll find the folder content I'm using (a standard template). > amforth ver. 4.5 the attachment seems to be stripped away on the mailing list, but let's see: > make DIR_ATMEL=~/wine/AvrAssembler2 wine ~/wine/AvrAssembler2/avrasm2.exe -I ~/wine/AvrAssembler2/Appnotes2 -I ../../core -I ../../core/devices/atmega128 -fI -v0 -e template.eep.hex -l template.lst template.asm ../../core\macros.asm(49): error: Illegal use of undefined or forward referenced symbol 'MCUSR' in conditional ../../core\macros.asm(57): error: Illegal use of undefined or forward referenced symbol 'MCUSR' in conditional Assembly failed, 2 errors, 0 warnings make: *** [template.hex] Error 1 This is probably, what you see. > grep MCU ~/wine/AvrAssembler2/Appnotes/m128def.inc ;* Target MCU : ATmega128 .equ MCUCR = 0x35 .equ MCUCSR = 0x34 ; MCUCR - MCU Control Register ; MCUCSR - MCU Control And Status Register ; MCUCSR - MCU Control And Status Register yupp, MCUSR is *not* defined in m128def.inc. Poking into the mega32 stuff, which I use a lot, I find a suspicious looking line here (last line): > grep MCU ~/wine/AvrAssembler2/Appnotes/m32def.inc ;* Target MCU : ATmega32 .equ MCUCR = 0x35 .equ MCUCSR = 0x34 ; MCUCR - General Interrupt Control Register ; MCUCSR - MCU Control And Status Register ; MCUCR - MCU Control Register ; MCUCSR - MCU Control And Status Register .equ MCUSR = MCUCSR ; For compatibility So adding that to m128def.inc, it changes the error message: > make DIR_ATMEL=~/wine/AvrAssembler2 wine ~wine/AvrAssembler2/avrasm2.exe -I ~/wine/AvrAssembler2/Appnotes2 -I ../../core -I ../../core/devices/atmega128 -fI -v0 -e template.eep.hex -l template.lst template.asm ../../core\words/store-i_nrww.asm(114): error: Operand 2 out of range: 0x68 ../../core\words/store-i_nrww.asm(122): error: Operand 1 out of range: 0x68 Assembly failed, 2 errors, 0 warnings make: *** [template.hex] Error 1 Hmm. That I haven't seen before. The lines in question both mention SPMCSR: 114: in temp1, SPMCSR 122: out SPMCSR,temp0 SPMCSR = $68, says the datasheet. So maybe "in" and "out" are out of range for $68. Anyone else knows about this? Cheers, Erich |