开发者

exception with Hello World, MPC 8280 (powerPC), on VxWorks 5.4

__asm__(".data\n\t"
        "msg:\n\t"
        ".string \"Hello, world!\\n\"\n\t"
        "len = . - msg\n\t"   
        ".text \n\t"               
        "li      0,4\n\t"
        "li      3,1\n\t"
        "lis     4,msg@ha\n\t"
        "addi    4,4,msg@l\n\t"
        "li      5,len\n\t"
        "sc           \n\t"
  ----> "li      0,1\n\t" 
        "li      3,1\n\t"
        "sc"       
        :
        :
        : "cr0","cr3","cr1","cr5","memory"
       );

I am trying to print Hello World! with the above code. But the code gives me an exception 开发者_运维百科at instruction after 'sc' i.e line marked with "---->". This I am trying to do on processor MPC 8280 (PowerPC) on vxWorks-5.4. On consulting some doc. found on internet, I came to know that sc is an exception. Can anybody please suggest me what can I do to accomplish this job. just for the sake of confirmation, the analogous code in x86 works perfectly there its int 0x80, that does the job of sc and triggers the system call, but for some reason it doesn't seem to work on PPC, here.

This is the first time that i have tried with assembly code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜