|
Message
From: Jeremy Bennett<jeremy@j...>
Date: Wed Jun 4 10:08:26 CEST 2008
Subject: [openrisc] question about asm
Hi Akira, I assume you are using the OpenRISC 1000 GNU toolchain for your C compilation. If so the assembly code is generated by the GCC asm directive. GCC will compile code to ensure the arguments to inline assembly end up in the correct place. There's lots of documentation for this online - try googling "GCC inline assembly". You won't necessarily have a l.nop after a branch - the compiler will try to fill the delay slot if possible. If you have an existing binary, you can look at the generated code using GDB for OpenRISC and the "disas" instruction. To understand what is happening, you should look at the OpenRISC 1000 Architecture manual (in the CVS tree under or1k/docs). In particular Chapter 16 explains how the application binary interface works, so you'll be able to interpret the stack from the compiled C program. Note that the OR 1000 l.nop instruction has an immediate argument, which has no impact on the semantics of the instruction. However it may be used by debuggers, simulators etc for additional purposes. For example the or1ksim architectural simulator uses these to implement printf() and exit(). I hope this helps. Jeremy
--------------------------------- Tel: +44 1202 417007 Cell: +44 7970 676050 SkypeID: jeremybennett Email: attachment.htm
|
 |