simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] simple assembler program behaves incorrectly


From: Johannes Deutsch
Subject: Re: [Simulavr-devel] simple assembler program behaves incorrectly
Date: Thu, 28 Jul 2011 10:54:41 +0200

On Wed, 2011-07-27 at 14:39 -0700, address@hidden wrote: 
> On Wed Jul 27 11:22 , Johannes Deutsch <address@hidden> sent:
> 
> >Here's the code of the assembler file:
> >
> >
> >#include 
> >
> >#define test 16
> >
> >.section .data
> >.equ k,255
> >output:
> >.asciz "Hallo Welt"
> >
> >.section .bss
> >.comm buffer, 20
> >
> >.section .text
> >.global main
> >
> >delay:
> >ld test, X
> >nop
> >ret
> >
> >main:
> >ldi XL, 0x60
> >ldi XH, 0x00
> >main_loop:
> >rcall delay
> >rjmp main_loop
> >
> >
> >After i loaded the binary file and connected gdb with simulavr
> >
> >(gdb) x/20xb &output
> >
> >yields an empty memory within the defined range.
> >
> >So the question i pose is, whether the error (that the string is not
> >located in the SRAM) is produced by simulavr or avr-gcc?
> 
> My suspicion is that for some reason you do not have the C runtime.
> How, if at all, did you link?
> 

Hi,

thank you for joining the discussion.

I didn't link by hand. Instead i let avr-gcc with the command

avr-gcc -mmcu=attiny2313 -x assembler-with-cpp  -Wa,--gstabs in.S -o
out.elf

do the job. Maybe you find more information about that in my answer to
Petr Hluzín in the same thread?

With best regards and thanks for your effort

Johannes D.

> --
> Michael Hennebry
> address@hidden
> "War is only a hobby."
> ---- Msg sent via CableONE.net MyMail - http://www.cableone.net
> _______________________________________________
> Simulavr-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/simulavr-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]