Skip to content
stpe edited this page Mar 1, 2013 · 1 revision

This section is a quick tutorial to get you started with the most fundamental features of JNiosEmu. If you have not already got JNiosEmu running, please see the installation instructions.

Run your first program

To run your first program in the emulator, open one of the example files or write the assembler code yourself (however, if you can do that, you likely won't need this tutorial). To open a file, select File / Open... (Ctrl+O) in the menu or click the open button in the toolbar, then select the file you want to open.

In order to run the program, you must first compile it. Press the compile button in the toolbar or select Emulator / Compile (Ctrl+F9) in the menu. If the compilation is successful JNiosEmu should now have switched to the Emulator.

Now you may either run the code until it ends, or step it one instruction at a time. As usual, there are both toolbar buttons and menu items for this.

See what happens

When executing (running) the compiled code in the emulator you are likely interested in what the result of the executed instructions are.

First of all, the instruction that is about to be executed is highlighted with a yellow bar in the emulator view. The address of this instruction is called the Program Counter (PC) and the address of the PC is indicated in the upper left corner.

Note that it is not uncommon that the assembler instruction you wrote actually is executed as another instruction. The first column in the emulator view is the op-code in hexadecimal, the second column is the instruction actually executed by the emulated processor and the third and right-most column is how your source code does look like.

Most operations are done on registers. The current value of all registers are displayed on the left side in the emulator view. When you execute your code you will see that some registers will have different backgrounds colors. Green means that the previous instruction did read that particular register, while red means that it wrote. This makes it easy to track what happens. Click on a register to see the value converted to hexadecimal, binary or decimal notation.

In a similar way to you may view values of variables or anywhere in the memory by selecting the appropriate item in the View menu.

Clone this wiki locally