d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Loading Value Of Address Instead Of Contents > Assembly -- Atmega16
Add Reply New Topic New Poll
Member
Posts: 11,971
Joined: Mar 10 2009
Gold: 17,046.00
Sep 29 2012 12:21pm
I'm playing around with the AtMega16, and I don't know why it is loading immediate values into my register instead of those contained in the memory address. I'm not using ldi, i'm loading s-ram.


ldi r16,$01
sts $0060,r16
ldi r16,$02
sts $0061,r16
ldi r16,$03
sts $0062,r16

lds r16,$0060
sts $0070,r16

lds r16,$0061
sts $0071,r16
lds r16,$0062
sts $0072,r16


The underlined works fine, and loads memory address 60 into the register.
The bolded ones load the value of the memory address into the register, the the address itself contains the values 2 and 3.

This post was edited by Evicted on Sep 29 2012 12:21pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll