asm-blocks: please tell me why I'm being thick :-)
asm-blocks: please tell me why I'm being thick :-)
- Subject: asm-blocks: please tell me why I'm being thick :-)
- From: Nigel Perry <email@hidden>
- Date: Wed, 24 Mar 2004 12:11:31 +1200
I'm trying to use asm-blocks and getting errors saying the first
thing in the block is invalid, whatever it is (instruction, register,
...). So I just copied the example in the docs into a new C++ tool
project:
#include <iostream>
asm int baz (int arg1) {
register int loc1, loc2;
@123
li loc1,4 * 89
nand. r5,arg1,loc1
ble- cr0, @123
otherlab: nop
mr r3,r5
}
int main (int argc, char * const argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
And compiled, no luck. On the command line I get:
[Asterix:~/Documents/PPC Docs/InlineAsmTest] nigel% g++ -fasm-blocks main.cpp
main.cpp: In function `int baz(int)':
main.cpp:4: error: parse error before `register'
main.cpp: In function `int main(int, char* const*)':
main.cpp:15: error: use of namespace `std' as expression
main.cpp:15: error: parse error before `::' token
So what obvious thing am I missing? Tried the archives, google, etc.
no joy. Tried really simple functions (two instructions a ld and a
blr...). Nada.
TIA,
Nigel
--
Nigel Perry, New Zealand
_______________________________________________
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.