• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
asm-blocks: please tell me why I'm being thick :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: asm-blocks: please tell me why I'm being thick :-)
      • From: Gerard Iglesias <email@hidden>
    • Re: asm-blocks: please tell me why I'm being thick :-)
      • From: Paul Russell <email@hidden>
  • Prev by Date: Object code missing from .a file
  • Next by Date: strange header copying behavior in framework target deployment style
  • Previous by thread: Re: Object code missing from .a file
  • Next by thread: Re: asm-blocks: please tell me why I'm being thick :-)
  • Index(es):
    • Date
    • Thread