Re: Statement-level assembler
Re: Statement-level assembler
- Subject: Re: Statement-level assembler
- From: Robert Purves <email@hidden>
- Date: Wed, 11 Feb 2004 17:06:20 +1300
Stan Shebs wrote:
Statement-level assembler blocks show a curious anomaly in that a
newline is apparently required after the opening brace (in Xcode
1.1). If it is omitted, a notably unhelpful error message results.
Does this behaviour have a rational explanation, or is it a bug?
asm { mr r3, sp } // error: parse error before "r3"
asm {
mr r3, sp } // OK
Um, a bug I think, at least if it works in CW. Asm statements require
special newline
handling (because newlines are required in asm, but not in C), I could
easily have
gotten this wrong.
Yes, it does work in CW without the redundant newline.
If CW compatibility is an issue, then here's an example that (a) works
in CW but not in Xcode, owing to case-sensitivity, and (b) gives a
really obscure and hard-to-find build error.
volatile UInt32 GetSP( )
{
register UInt32 dest;
asm
{
mr dest, sp // OK
}
asm
{
mr dest, SP // {standard input}:87:Parameter syntax error (parameter
2)
}
return dest;
}
Robert P.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.