IP-NIOS Altera, IP-NIOS Datasheet - Page 172
IP-NIOS
Manufacturer Part Number
IP-NIOS
Description
IP NIOS II MEGACORE
Manufacturer
Altera
Type
Licenser
Specifications of IP-NIOS
Processor Type
RISC 32-Bit
Lead Free Status / RoHS Status
Not applicable / Not applicable
Features
-
Package / Case
-
Mounting Type
-
Voltage
-
Speed
-
- Current page: 172 of 294
- Download datasheet (3Mb)
7–8
Nios II Processor Reference Handbook
Arguments
Return Values
The first 16 bytes to a function are passed in registers r4 through r7. The arguments
are passed as if a structure containing the types of the arguments were constructed,
and the first 16 bytes of the structure are located in r4 through r7.
A simple example:
The equivalent structure representing the arguments is:
The first 16 bytes of the struct are assigned to r4 through r7. Therefore r4 is assigned
the value of a and r5 the value of b.
The first 16 bytes to a function taking variable arguments are passed the same way as
a function not taking variable arguments. The called function must clean up the stack
as necessary to support the variable arguments. Refer to
with Variable Arguments” on page
Return values of types up to 8 bytes are returned in r2 and r3. For return values
greater than 8 bytes, the caller must allocate memory for the result and must pass the
address of the result memory as a hidden zero argument.
The hidden zero argument is best explained through an example.
Example 7–2. Returned struct
/* b() computes a structure-type result and returns it */
STRUCT b(int i, int j)
{
}
void a(...)
{
}
In
and r3.
Example
int function (int a, int b);
struct { int a; int b; };
...
return result;
...
value = b(i, j);
7–2, if the result type is no larger than 8 bytes, b() returns its result in r2
7–5.
Chapter 7: Application Binary Interface
“Stack Frame for a Function
December 2010 Altera Corporation
Arguments and Return Values
Related parts for IP-NIOS
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
CYCLONE II STARTER KIT EP2C20N
Manufacturer:
Altera
Datasheet:
Part Number:
Description:
CPLD, EP610 Family, ECMOS Process, 300 Gates, 16 Macro Cells, 16 Reg., 16 User I/Os, 5V Supply, 35 Speed Grade, 24DIP
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
CPLD, EP610 Family, ECMOS Process, 300 Gates, 16 Macro Cells, 16 Reg., 16 User I/Os, 5V Supply, 15 Speed Grade, 24DIP
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
CPLD, EP610 Family, ECMOS Process, 300 Gates, 16 Macro Cells, 16 Reg., 16 User I/Os, 5V Supply, 30 Speed Grade, 24DIP
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
High-performance, low-power erasable programmable logic devices with 8 macrocells, 10ns
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
High-performance, low-power erasable programmable logic devices with 8 macrocells, 7ns
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
Classic EPLD
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
High-performance, low-power erasable programmable logic devices with 8 macrocells, 10ns
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
Manufacturer:
Altera Corporation
Datasheet:
Part Number:
Description:
CPLD, EP610 Family, ECMOS Process, 300 Gates, 16 Macro Cells, 16 Reg., 16 User I/Os, 5V Supply, 25 Speed Grade, 24DIP
Manufacturer:
Altera Corporation
Datasheet: