對於返回一個簡單的類型的功能:然後其餘部分被放置在棧上
r0 = self (NSString)
r1 = _cmd (@selector(stringWithFormat:))
r2 = 1st argument (@"%@, %@")
r3 = 2nd argument (@"Hello")
:
[sp,#0] = 3rd argument (@"World")
[sp,#4] = 4th argument (does not exist in your example)
...
當然,「參數」在這裏是指一個4字節的對象。如果參數大於4個字節,則它將被分割出來,例如,
-[UIView initWithFrame:rect];
r0 = self
r1 = _cmd
r2 = rect.origin.x
r3 = rect.origin.y
[sp,#0] = rect.size.width
[sp,#4] = rect.size.height
返回值(最多16字節)將被放置在r0,r1,r2,r3中。
對於返回一個結構功能:r0
用於存儲返回值的指針。
NSRange retval = [self rangeOfString:string options:options range:range]
r0 = &retval (of type NSRange*)
r1 = self
r2 = _cmd (@selector(rangeOfString:options:range:))
r3 = string
[sp,#0] = options
[sp,#4] = range.location
[sp,#8] = range.length
這正是我需要知道的,謝謝你的支持! – overboming 2010-03-14 13:57:30
優秀的答案。 – 2010-03-16 15:30:13
恩,我意識到這是一個愚蠢的問題,但是......你如何訪問寄存器? – 2010-04-10 17:08:44