This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM SWI


Hi Vijay,

	Can anyone tell what does %1, %2, %a3 mean in the following line
"mov r0, %1; mov r1, %2; swi %a3; mov %0, r0".

This is GCC's extended asm syntax. Please check the GCC manual for more information.


%1 means "substitute the second argument here". In this case that would be the register containing the variable "reason".

%2 means "subsititute the third argument here". So this would be the register containing the variable "arg".

%a3 mean "subsitute the fourth argument here, as if it were an address, not a register name". So in this case the value of the variable "AngelSWI" will be substituted.

%0 means "substitute the first argument here", ie the register which will contain the variable "value" after the asm() statement has completed executing.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]