I want to fill the entire RAM with 0x55.
my Ram address is (0x100 to 0x4ff). i am using stk500& 502 board. i am using assembly language program. I am using amega 169
ram size = 0x400 -0x100 = 0x3ff
code for this:
LDI R27, 0X01 //ram low address high byte ldI R26,0x00 //ram low address low byte ldi R25,0X03 //ram size high byte ldi R24,0Xff //ram size low byte LDI R16,0x55 //to be written value st x,r16 // fill 0x100 with 0x55 loop2: sbiw r25:r24,1 brne loop1 nop loop1: ld r2,x+ st x,r16 jmp loop2
My x pointer pointing to 0x100. ram size is in r25, r24. I want to decrement the ram size(0x3ff to 0)every time . When the count reaches 0, my pointer x will be in 0x4ff.
loop2: sbiw r25:r24,1
is giving the following error
../RamInit.S: Assembler messages: ../RamInit.S:18: Error: register r24, r26, r28 or r30 required ../RamInit.S:18: Error: `,' required ../RamInit.S:18: Error: garbage at end of line make: *** [RamInit.o] Error 1 Build failed with 1 errors and 0 warnings...
Does this instruction subract one from the r24 only?I don't understand how this instruction works in a loop.
How to decrement my count value(3ff-1)?
is there any other instruction or way to decrement my count value in a loop?because it need 2 bytes.