Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System Call Curiosity



Sam, you need to return control back to the system (which is not done
automatically for you). That's a bit simplified, but it's the gist.
There's a really old thread in the archives about this from about a year
or so ago (I had the exact same question). Lightsoft's Beginner's Guide
to PowerPC Assembly Language covers it some, too.

Add a call to "blr" to the very end and you should be golden.

Cheers!
Sean


> ---------- cut here -------------
> .data
> .cstring
> .align 2
> msg:
> .asciz "Hello world!\n"
> len = . - msg
> .text
> .align 2
> .globl _start
> _start:
> li r0,4
> li r3,1
> lis r4,ha16(msg)
> ori r4,r4,lo16(msg)
> li r5,len
> sc
> li r0,1
> li r3,0
> sc
> ---------- cut here -------------
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.