Getting Started Mikrocodesimulator Mikrosim 2010 and Code-Generator Mikrobat 2010
Total Page:16
File Type:pdf, Size:1020Kb
Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 Getting Started Mikrocodesimulator MikroSim 2010 and Code-Generator MikroBAT 2010 On following pages a short overview of the possibilities to create microcoding machine codes with the Mikrocodesimulator MikroSim 2010 is given, and how applying it when assembling binary code with the Code-Generator MikroBAT 2010. By means of several specially selected examples, i.e. in which simply the register A (R1) of the Mikrocodesimulator is incremented by one, the functionality of the simulator is explained step by step. At first, in the so called exploration mode the 49-bit microcode is investigated in its functionality. Already only one single microcode itself can control the execution of the incrementation of a register. In the next example, the microcode simulation mode is explained, that uses already programmed microcode examples provided by the simulator setup routine. The incrementation can be achieved in a sequence of microcode instructions (Example 1), in a looped sequence of microcode instructions (Example 2) or in a looped sequence of microcoded machine codes (Example3). Finally, a microcoded machine code program is presented which calculates the factorial (i.e. n!) of an integer value. Installation of the Mikrocodesimulator MikroSim 2010 The Mikrocodesimulator MikroSim 2010 is distributed with its own installation program that ease you the installation on your MS-Windows system. At the beginning of the installation the user can choose between two installation languages: English and German. The setup language automatically determines the start up-language of the simulation application. Of course, in the application itself the user can choose at any time the start-up language of the user interface of the bilingual software. Fig. 1: Selection of the preferred start-up language and for the setup. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 1 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 After having selected the installation language, the setup program asks for the destination path where the simulation program should be installed in. After defining the destination directory the installation carries on with directive interruptions. During the installation, a new program group is created in the start menu where links to the executable file, the help files, and the documentation are listed. Fig. 2: During the Mikrocodesimulator program installation a new program group and an application link is created in the start menu in MS-Windows. The Mikrocodesimulator is registered as a 32-bit application in MS-Windows registry and can be uninstalled on demand. Therefore, any deinstallation should be initiated by selecting either the deinstallation option in the system folder or by using the uninstall option in the group menu. In case you intend to update the simulator, it is recommended first to uninstall the existing installation and continue with the installation of the update package. Doing so, only install package related files are deleted and updated. Own created simulator files and especially the software registration “MikroSim.PLF” is kept unchanged, provided you have created or copied a licence to this directory. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 2 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 Starting the Simulator in the Exploration Mode The microcode simulator MikroSim 2010 is started by clicking onto the green-grey coloured CPU icon. The start-up window is in the beginning greenish patterned layout which symbolises a non constructed CPU-controller application, i.e. an unassembled printed circuit board. The user is in the so-called ”exploration mode”. In this mode the CPU can be built up step by step component wise by entering the menu topic “Options/Simulation Levels”. Successively, the registers, the arithmetic-logical unit, the external RAM, the microcode ROM, and the microcode address- calculator can be added to the CPU. Before resetting the CPU simulator by pressing the “Reset” button in the upper left corner of the main window, the registers of all CPU components are marked with their names that indicates the intended usage of them and implicit the relation to the microcode (Fig. 3). Fig. 3: Stepwise construction of the Mikrocodesimulator in the exploration mode. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 3 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 When selecting the last entry of the simulation level menu, the setup is being completed with all its components as shown in Fig. 4. Fig. 4: Completely constructed Mikrocodesimulator in the exploration mode. In the Mikrocodesimulator all registers and CPU components reveal information, which can be reviewed on areas where the standard mouse pointer changes its shape to a help mouse pointer . When clicking onto such areas, an information window is opened with additional hints or comments like in Fig. 5. Fig. 5: Here, information of the purpose of the Y-Register databus is shown up. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 4 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 After the user is familiar with the CPU setup, the functionality of the 49-bit microcode that is displayed at the top edge of the CPU component in the main window, can be explored in more detail. For simplicity in this step all other confusing elements of the application can be hidden by selecting the menu item „Options/Simulation Level/... and RAM“ (Fig. 6). Fig. 6: Initialised Mikrocodesimulator in the exploration mode after pressing the “Reset” button. Only the register set and the external RAM is built up. In order to investigate the single bits of the four selected bit groups of the 49 bit long microcode, please initialise the simulator by pressing the reset button first. As shown in Fig. 6, all registers are initialized now with binary or hexadecimal values instead of their descriptive labels. Values of all registers can be modified by means of a special editor in which the value can be entered either in the binary, hexadecimal, unsigned decimal, or signed decimal format. For 32-bit register values, the representation of floating point numbers with single precision according IEEE754 standard is possible, too. The value entered in one of these formats is converted immediately into the other number formats. After entering the values and leaving the editor with „OK“, the value of the modifying register is transferred into the register that has been chosen for modification. The number format of the value transferred is back coloured green. Depending on the usage of the register as a switch or as a number the preferred format is binary or hexadecimal, respectively. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 5 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 Fig. 7: By means of this special number editor the values of a selected register can be modified in five different number representations. In this way the Mikrocodesimulator can be explored in the exploration mode bit after bit. For example writing “01000000“ into the Y-bus and Z-bus group of the actual microcode command, one can trace by pressing the oscillator button how the value of the 32-bit register R1 is loaded into the Y-register of the ALU and the Z-register value is transferred back to the 32-bit register R1. During this operation the responsible circuits for the data transfer are highlighted. Setting additionally the 7-bit value of the ALU function code to binary 6=110b, in each calculate phase the Y-register is incremented by one and stored in the z-register of the ALU. So a complete get- calculate-put cycle increments the register R1 by one. Fig. 8: This microcode instruction in the bottom line of the main window increments the register R1. All other bits can be investigated similarly as explained above. Several reference tables in the help file gives a detailed overview about the meaning of each bit of the microcode instruction. In order to learn the usage of the Mikrocodesimulator, specially prepared example files are discussed in the following. An example file can be loaded using the menu item „File/Open ...“. © Dr. Martin Perner, Josef-Sterr-Str. 13, D-81377 München, Germany URL: http://www.mikrocodesimulator.de E-Mail: [email protected] Page 6 A Software Product of Mikrocodesimulator MikroSim 2010 Code-Generator MikroBAT 2010 Microcoding Example #1: As already mentioned in the previous section, in the exploration mode one single microcode instruction is executed, namely that which is displayed in upper CPU area. The next exploration step is now how to get a sequence of 49-bit long microcode instructions to be executed successively. By loading or creating new micrcocodesimulator files the exploration mode is quit. Loading “Demo001.ROM” via the menu item „File/Open ...“ all other related files of the type “Demo001.*” are loaded, too. After files loaded, the complete application is set up. The exploration mode is now replaced by the microcode simulation mode. Nevertheless, even in that simulation mode one is able to control the execution step by step by changing individual bits of the microcode or register values. Fig. 9: Initialised Mikrocodesimulator that has loaded the microcoding example “Demo001”. After “Demo001” has been loaded into the simulator, an initialisation by pressing the reset button is mandatory. All buttons of the simulator are now enabled, also the ROM button in the upper left area of the in the CPU device.