Gast
#111464
Hallo Leute,
folgende Funktion lässt sich nicht kompilieren :
int AddUp (
int n,
int near *pTab)
{
__asm { ; open inline-assembly block
mov r2,pTab ; R2:=start of table
mov r3,n
cmp r3,#0
jmp cc_sle,stop ;
shl r3,#1 ; n * 2
add r3,r2 ; R3 := (n*2)+pTab, end of table + 2
mov r4,#0x00 ; clear result
lM: add r4,[r2+] ; add up next value
cmp r2,r3 ; end of table ?
jmp cc_nz,lM ; loop if not eot
ret ; need result in R4
stop:
nop ; single line assembly
nop ; another nop }
return (0);
}
Der Fehler scheint zu sein, dass die Variablen "pTab" und "n" im
Assembler-Code nicht als Variablen erkannt werden und dann beim
Ausführen des Assmeblers als "undefined symbols" eingehen. (Übrigens
das ist ein Beispiel-Code von www.Keil.com (dieser Minuten leider
server down)).
Ist es vielleicht eine Compiler-Option, die ich übersehen habe ?!
Danke für Eure Hilfe !
MfG, Khani