HOW TO USE THE SEIJI HARIKI HIPO SIMULATORValdemar W. Setzer 1. Introduction 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 www.ime.usp.br/~vwsetzer/HIPO/hipo-descr.html The simulator, programmed by Victor Seiji Hariki, may be loaded into a web browser presently from https://seijihariki.github.io/HIPO-simulator/#/ It may be downloaded using the browser Save command, for later local use. 2. Using the simulator
3. Writing code into the Code window Suppose 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: 1 +3145 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. 12 Rules: 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 it later. 2. It is necessary to use the +XXXX instruction format. 3. The button Translate can be activated at any time. 4. 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".
For an explanation of each instruction, see https://www.ime.usp.br/~vwsetzer/HIPO/hipo-descr.html 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 where
5.2 Data format XX Label Value
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 it generates the following code loaded into the storage: 01 +1130 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. |