About the MIMA -------------- The MIMA (MInimal MAchine) is a hypothetical microprocessor used in teaching at the KIT. This program allows the user to write programs in Assembler and compile them into an ASCII-based memory map file, which can in turn be used by an interpreter. About this document ------------------- This document serves as reference manual to the implementation of the MIMA Architecture as present in mimasm/mimasim. It partly references content from http://ti.ira.uka.de/Visualisierungen/Mima/mima-aufgaben.pdf (mainly the OP-Code listing). Further information about the mima can be found at it's creators homepage at http://ti.ira.uka.de/ The mimasm/mimasim project is found at http://dev.cbcdn.com/kit/ Comments, bug reports and feature requests should be directed to cbdev on irc://irc.freenode.net/ cb@cbcdn.com MIMA-Assembler -------------- Integers can be given in decimal or hexadecimal (prefix with '$') format. Ex: $64 equals 100 The MIMA uses a 24 Bit data word, of wich the most significant 4 bit are always an OP-Code. If these 4 bits are equal to '0xF', the OP-Code spans the most significant 8 bits (extended OP-Code) and does not take a parameter. In all other cases, the remaining 20 bits are considered the parameter to the OP-Code. Integers are internally represented in two's complement. The MIMA has no floating- or fixed-point number support. For the purposes of this document, should be substituted with an integer value should be substituted with an appropriate ASCII string not containing any spaces should be substituted by any defined OP-Code/Parameter combination denotes an argument of type TYPE, referred to as [] denotes an optional argument Directives ---------- *= Sets the current memory position = Sets a global constant (similar to C's preprocessor directive '#define') Programmatic Statements (mnemonics) ----------------------------------- Every line containing a mnemonic can be labelled by prefixing it with : The label will then be treated as a global constant containing its location in memory. DS [INT:CONST] Store at the current memory location. If not given, 0 is stored. This is the only statement allowing the full 24 bit memory word to be set. LDC Load into the accumulator. OP-Code 0x0 LDV Load the contents of memory cell into the accumulator. OP-Code 0x1 STV Store the contents of the accumulator to memory cell OP-Code 0x2 ADD Add the contents of memory cell to the accumulator OP-Code 0x3 AND Performs logical AND of content of cell and accumulator. Result is stored in accumulator. OP-Code 0x4 OR OR's the content of cell with the accumulator. Result is stored in accumulator. OP-Code 0x5 XOR XOR's the content of cell with the accumulator. Result is stored in Accumulator. OP-Code 0x6 EQL Checks for equality of the accumulator's contents and the content of the memory cell at . If they are equal, the accumulator is set to -1, else it is set to 0. OP-Code 0x7 JMP Continue execution at specified address OP-Code 0x8 JMN Continue execution at specified address if accumulator's contents are negative OP-Code 0x9 LDIV Load indirect (Address to load from is in cell specified by parameter) OP-Code 0xA STIV Store indirect (Address to store to is in cell specified by parameter) OP-Code 0xB JMS Jump to subroutine. Stores the address of the next instruction at and jumps to OP-Code 0xC JIND Jump indirect (Address to jump to is in cell specified by parameter) OP-Code 0xD HALT Stop execution OP-Code 0xF0 NOT Invert accumulator contents OP-Code 0xF1 RAR Perform right rotate on accumulator OP-Code 0xF2 -FJS 2012-2013