Little Dan Computer Instruction Set

This document defines the operations supported by the Little Dan Computer and their respective descriptions.

Instruction Set
Instruction Operand Machine Code (DEC) Description
LDA Address 06XXX Loads the value from the specified memory address into the accumulator.
LDD Value 07XXX Loads the immediate value into the accumulator.
ADD Address 01XXX Adds the value from the specified memory address to the accumulator.
SUB Address 02XXX Subtracts the value from the specified memory address from the accumulator.
MUL Address 03XXX Multiplies the accumulator by the value from the specified memory address.
DIV Address 04XXX Divides the accumulator by the value from the specified memory address.
MOD Address 05XXX Calculates the modulus of the accumulator by the value from the specified memory address.
STA Address 08XXX Stores the value of the accumulator into the specified memory address.
JMP Address 09XXX Sets the program counter to the specified memory address.
JEQ Address 10XXX Jumps to the specified memory address if the accumulator equals zero.
JNE Address 11XXX Jumps to the specified memory address if the accumulator is not zero.
JGT Address 12XXX Jumps to the specified memory address if the accumulator is greater than zero.
JLT Address 13XXX Jumps to the specified memory address if the accumulator is less than zero.
INP None 14000 Reads an input value and loads it into the accumulator.
OUT None 15000 Outputs the value in the accumulator.
OTC None 16000 Outputs the character represented by the value in the accumulator (use an ASCII chart for reference).
CLR None 17000 Clears the output display.
HLT None 00000 Halts program execution.
DAT Label (prefix)
Value (postfix)
Allocates memory for data to be stored. During assembly, data labels are replaced with their memory addresses. Example usage:
ONE DAT 1
FN Label (prefix) A procedure/function label which could be used by a jump instruction.