HOW TO USE THE SEIJI HARIKI HIPO SIMULATOR
Valdemar W. Setzer
This version: Oct 6, 2019
For a description of the HIPO virtual computer, which was developed to
be used in introductory courses on programming, showing what a machine
language and its logics are, see
The simulator, programmed by Victor Seiji Hariki, may be loaded into
a web browser presently from
It may be downloaded using the browser Save command, for later local
2. Using the simulator
- At left, one may see three windows, labelled Code (this title is presently missing), Input and Output.
At their right there is a HIPO storage map, already initialized with
+0000 in every storage position.
- To insert code or data into the storage map, click with the right
mouse key on a cell. A menu appears; the last option permits the editing
of a storage cell. If chosen, a window is opened allowing typing of its
desired contents. It is not necessary to type a HIPO word with signal
(+ or -) and 4 digits. So one may type 12 or -12, converted automatically
to +0012 and -0012 respectively.
running a code, one may insert instructions in the code window, one per
line. The first line has the implicit adress 0, the second one 1 and so
on, unless an address is specified before the instruction, such as 5
+2115. The instruction +2115 will be inserted into storage position 05.
- In the upper menu, the rightmost field "Reading pointer", shows the line number
that is going to be read in the next input instruction (+31XX).
- Input lines may be deleted using the Delete key.
- Output (+41XX) is written sequentially on the Output window, one per
line. In the present version, it can be erased with the Clear I/O button.
- To run a program, set the field "Pointer position" to the
storage address of the program's first instruction to be executed.
- Buttons Run and Step produce a whole or stepwise (instruction by instruction)
execution of the program presently displayed in the storage map.
- The Reset button resets all storage proisitons to +0000, and the Instruction
pointer, Accumulator and Reading pointer fields to 0. It does not affect
the Code, Input and Output windows. The Clear button clears everything.
- The window Code allows programming and editting a code; the button
Translate inserts it into the storage to be run.
3. Writing code into the Code window
one has typed the following program (reads data from the Input window
and prints data into the Output window indefinetly -- use the Step
button to test it); one may simply copy the following 4 lines and paste
them into the Code window and then hit the Translate button to transfer
it into the HIPO storage:
Notice that the three instructions will be inserted into storage positions 1, 2 and 3 and the number +0999 into position 45. Just to remember, +31XX, +41XX and +51XX are, respectively, Input, Print
and Unconditional jump instructions.
Suppose some input is written in the Input window, e.g.
set the IP (Instruction pointer) to 1, the address of the first
instruction (+3145). Hitting the Step button produces the execution of
this input instruction. If the input window is empty, an error
will appear i the message window (below the storage map window).
Hitting Step again will produce the execution of the program.
1. In the Code window one may write a HIPO code, one instruction or data
per line. Hint: one may save a program from the Code window into the Windows
(or other operating system) transfer area or into some file, reloading
2. It is necessary to use the +XXXX instruction format.
3. The button Translate can be activated at any time.
If no address is inserted before the first instruction or data at the
Code window, its address will be set at 00. Subsequent instructions or
data without preceeding addresses will be inserted into the following
storage positions. If there is an address preceeding an intruction or
data, subsequent instructions or data wihtout addresses will be
inserted into subsequent addresses.
5. In the example above, position 45 was initialized to +0999 just as
an example on how to insert data into storage.
6. The first line at the Code window has to have some instruction or
data!!! Otherwise, a message
Error:Label undefined not found!!
will appear. One has to leave this window by hitting its OK button.
7. Comments may be inserted after an instruction or data, preceeded by a ; sign or enclosed in brackets [...].
4. The HIPO instruction set
Notation: The first column shows the mnemonic code in Portuguese (which
can be used when programming in the present assembly language, see next
section). The second column contains the mnemonic codes in English, as
specified in the hipo-descr page referred to in the Introduction. The
third column contains the HIPO instruction codes. The fourth column contains
a concise description of the instruction. [XX] should be read "the
contents of storage position with address XX"; Acc: the accumulator;
[Acc]: contents of the accumulator. <-- stands for "receives".
||Acc <-- [XX]
||XX <-- [Acc]
[Acc] + [XX
||Acc <-- [Acc] - [XX]
||Acc <-- [Acc] * [XX]
||Acc <-- [Acc] / [XX]
||Acc <-- [Acc] % [XX]
||XX <-- -[Acc]
||XX <-- [input]
||Output <-- [XX]
||Unconditional jump to
instruction at XX
||If Acc<=0 jump to XX
||If Acc<>0 jump to
XX (<>: different than)
||If Acc>0 jump to XX
||If Acc=0 jump to XX
||If Acc<0 jump to XX
||If Acc>=0 jump to XX
For an explanation of each instruction, see
5. Writing assembler code
The Code window permits writing instructions using the HIPO assembler
language. Hitting the Translate button produces the corresponding machine
code, which is loaded into the storage unit. Unfortunately, present mnemonic
codes, given in the previous section, are only in Portuguese. Using codes
in English is being planned.
5.1 Instruction format
XX Label Mnem Arg
- XX is the HIPO address where this instruction is going to be loaded. If the subsequent instructions don't have an address XX,
they will be automatically be loaded into consecutive addresses.
- Label is an optional name beginning with a letter. If followed by a number X or XX, this number will be assigned to the label.
- Mnem is the mnemonic code of the instruction, either in Portuguese or English.
- Arg (for "argument") is a storage address of the form X
or XX, or a label indicating some storage position.
- Comments may be inserted after the contents of each line, preceeding
it with a ; or can be inserted anywhere in a line if enclosed by [...].
5.2 Data format
XX Label Value
- XX as above
- Label is a name beginning with a letter; if this laber is used afterwards, it will be replaced by XX
- Value is the initial value wich will be stored into position XX
5.3 Assembler code example
The following assembler code example generates a program that inputs
a list of non-negative numbers, prints each number and produces their
sum. The list has to be ended by a negative number, which is not included
into the sum.
When the following program is copyed into the Code area and the Translate
button is hit,
1 CEA Zero
Back Lei Num
End Imp Sum
30 Zero 00
40 Sum 00
45 Num 00
it generates the following code loaded into the storage:
This HIPO code can be directly copied and pasted into the Code area;
hitting Translate will load into the storage unit extactly the same code
as the code generated by the assembly code above.