02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

simply supply the address in place of the function name. Thus the following<br />

expression calls a parameterless function whose entry point is at address 10000<br />

hex:<br />

0x10000 ()<br />

Subroutines as Commands<br />

Both VxWorks and the <strong>Tornado</strong> shell itself provide routines that are meant to be<br />

called from the shell interactively. You can think of these routines as commands,<br />

rather than as subroutines, even though they can also be called with the same syntax<br />

as C subroutines (and those that run on the target are in fact subroutines). All the<br />

commands discussed in this chapter fall in this category. When you see the word<br />

command, you can read subroutine, or vice versa, since their meaning here is<br />

identical.<br />

Arguments to Commands<br />

In practice, most statements input to the shell are function calls, often to invoke<br />

VxWorks facilities. To simplify this use of the shell, an important exception is<br />

allowed to the standard expression syntax required by C. When a function name is<br />

the very first item encountered in a shell statement, the parentheses surrounding<br />

the function’s arguments may be omitted. Thus the following shell statements are<br />

synonymous:<br />

as are:<br />

-> rename ("oldname", "newname")<br />

-> rename "oldname", "newname"<br />

-> evtBufferAddress ( )<br />

-> evtBufferAddress<br />

However, note that if you wish to assign the result to a variable, the function call<br />

cannot be the first item in the shell statement—thus, the syntactic exception above<br />

does not apply. The following captures the address, not the return value, of<br />

evtBufferAddress( ):<br />

-> value = evtBufferAddress<br />

180

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!