MM1 Instruction Set Reference

Note: The assembler treats all lines beginning with a space or '#' as comments
Mnemonic Name Usage Description
ADDAddADD src1 sr2 destAdd values in src1 and sr2 registers and store result in dest register. (dest=src1+sr2)
SUBSubtractSUB src1 sr2 destSubtract value in src1 from sr2 register and store result in dest register. (dest=src1-sr2)
DIVDivideDIV src1 sr2 destDivide value in src1 register by value in sr2 register and store result in dest register. (dest=src1/sr2)
MULMultiplyMUL src1 sr2 destMultiply values in src1 and sr2 registers and store result in dest register. (dest=src1*sr2)
INCIncrementINC destIncrement (add one to) value in dest register.
LDLoadLD addr destLoad load contents of memory location addr into register dest.
STStoreST src1 addrStore value in register src1 in memory location addr
MOVMoveMOV src1 destCopy value in register src1 to dest register.
JMPJumpJump addrJump to instruction at memory location addr
JZJump if ZeroJZ addrJump to addr if the Zero Flag is set indicating a result of zero from the last ALU operation.
JNJump if NegativeJN addrJump to addr if the Sign Flag is set indicating a negative result from the last ALU operation.
PUSHPush onto the stackPUSH reg Copy contents of register reg to the stack (the memory location pointed to by the stack pointer and decrement the stack pointer by one. THe stack pointer is initialized to point to memory address 63.
POPPop from the stackPOP reg Increment the stack pointer and copy the value at that memory address it points to into register reg.
CALLCall a procedureCALL addrPush the address of the next instruction after this CALL onto the stack and jump to memory address addr.
RETReturn from procedureRETPop the value on top of the stack into the program counter. This instruction assumes that the value on the stack was a return address pushed by a previous CALL instruction.
HALTHaltHALTHalt processor. Processor will no longer fetch instructions until reset.