[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Simulavr-devel] Change IO-port value
From: |
Valber |
Subject: |
[Simulavr-devel] Change IO-port value |
Date: |
Thu, 06 Sep 2012 22:25:14 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 |
Hi everybody!
I want to try debuging GNU ASM programms by simulavr, but have no ideas
how to change registers values while step by step debuging, i.e.
simulate events
=======exampe.S=======
#include <avr/io.h>
#define SFR(X) _SFR_IO_ADDR(X)
temp = 16
START = PD0
STOP = PD1
.section .text
.global main
main:
rjmp init
init:
ser temp
out SFR(DDRB),temp
out SFR(PORTB),temp
clr temp
out SFR(DDRD),temp
ldi temp,0x03
out SFR(PORTD),temp
waits: sbis SFR(PIND),START
rjmp waits
nop
nop
nop
nop
rjmp init
============================
Compile:
avr-gcc -Wa,--gstabs -mmcu=atmega16a example.S -o example.o
Simulavr - start server and watch registers state:
simulavr -g -P simulavr-dip -X -d atmega16
How I can change PIND state? I'm using Emacs as IDE.
Best Regards
Valber