Keil™, An ARM® Company

Discussion Forum

why Adds is error but add is correct?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
roguebear Lalala
Posted
20-Apr-2005 03:36
Toolset
None
New! why Adds is error but add is correct?
In keil arm 2.11

while(1)
{
__asm
{
START: MOV R0,#0 MOV R1,#10
LOOP: BL ADD_SUB B LOOP
ADD_SUB:
ADD r0,r0,r1
//ADDS r0,r0,r1 <---error??
MOV PC,LR
}
}


FIBO.C(76): error C197: inline-asm: undefined identifier
Read-Only
Author
Reinhard Keil
Posted
20-Apr-2005 03:46
Toolset
None
New! RE: why Adds is error but add is correct?
Looks like you are working in Thumb mode, where there is not 'ADDS' instruction.

See: http://www.keil.com/support/docs/2991.htm

Reinhard
Read-Only
Author
roguebear Lalala
Posted
20-Apr-2005 03:53
Toolset
None
New! RE: why Adds is error but add is correct?
I found that if use adds in __asm{},there will be a message -- error C197: inline-asm: undefined identifier!! i use keil arm 2.11
Read-Only
Author
roguebear Lalala
Posted
20-Apr-2005 03:57
Toolset
None
New! RE: why Adds is error but add is correct?
also EQU !
I must use #define NUMBER_COUNT 0x40003000 but can't use __asm(NUMBER_COUNT EQU 0x40003000 )
Read-Only
Author
Reinhard Keil
Posted
20-Apr-2005 04:02
Toolset
None
New! RE: why Adds is error but add is correct?
EQU is an assembler control statement, but not an assembly instruction. You can only use assembly instructions with the in-line assembler!

Next Thread | Thread List | Previous Thread Start a Thread | Settings