Hi,
I'm trying to learn Assembler programming and I'm supposed to write a program that does this:
- stores 5 numbers
- reads those numbers and calculates the sum
- writes the sum on the diodes of my practice board (STK500)
Here's what I got:
.nolist
.include "m32def.inc"
.list
.def sum=R21
clr sum
out ddrb, sum
ldi R16, 0x2c
ldi R17, 0x0f
ldi R18, 0x49
ldi R19, 0x37
ldi R20, 0x19
add sum, R16
add sum, R17
add sum, R18
add sum, R19
add sum, R20
out PortB, sum
But nothing happens. Do I need some sort of ending to the program?
I'm trying to learn Assembler programming and I'm supposed to write a program that does this:
- stores 5 numbers
- reads those numbers and calculates the sum
- writes the sum on the diodes of my practice board (STK500)
Here's what I got:
.nolist
.include "m32def.inc"
.list
.def sum=R21
clr sum
out ddrb, sum
ldi R16, 0x2c
ldi R17, 0x0f
ldi R18, 0x49
ldi R19, 0x37
ldi R20, 0x19
add sum, R16
add sum, R17
add sum, R18
add sum, R19
add sum, R20
out PortB, sum
But nothing happens. Do I need some sort of ending to the program?