NiosII Instruction Examples
- isa1.s tests the add/sub and
logical-operation instructions.
- isa2.s tests the shift and rotate instructions.
- isa3.s tests the compare instructions.
- isa4.s tests the branch instructions. It is the first example
with instructions executed in non-sequential order.
- isa5.s tests the call, callr, jmp,
and ret instructions. It also tests the nextpc
instruction.
- isa6.s uses
stw and ldw instructions, referenced to the stack or
frame pointer. The stack pointer is set explicity and then copied to
the frame pointer. This means that there are no references to memory
other than through the stack.
- isa7.s uses a
.data section and tests the load and store instructions for
bytes and half-words. The simulator, therefore, must incorporate a
data memory with initialized values and contend with absolute memory
references.
- main1.c illustrates startup and
termination of a NiosII porgram in the instruction-set-simulator
(ISS). It contains examples of function calls and argument passing.
- main2.c shows the storage of
global and local variables.
Maintained by John Loomis,
last updated 19 February 2008