STR32 - Hardfault Exception bei Befehl "sub"

Gast #1660604
Lesenswert?

Hallo,

kann mir jemand vielleicht erklären warum bei diesem Code eine Exception 
geworfen wird?

ldr   r0, [pc, #0x40] // lcd_ram address
ldrh  r1, [r7, #0x10] // color
ldr   r3, [r7, 0x18]  // counter
str   r3, [r7, #0x14] // save counter

loop:
cbz   r3, loop_end   // if counter == 0 jump after loop
strh  r1, [r0, #0x0] // write color
sub   r3, r3, 0x1    // decrement counter
b     loop

loop_end:


Wenn ich strh weglasse passiert nichts.
Danke schonmal im vorraus

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren