Knob & Switch Computer Company
K & S Model 2 - Assembly & Machine Language Instruction Set




Data Movement Instructions:
Assembly Language Instruction:Example:Meaning:Machine Language Instruction:
LOAD [REG] [MEM]
STORE [MEM] [REG]
MOVE [REG1] [REG2]
LOAD R2 13
STORE 8 R3
MOVE R2 R0
R2 = M[13]
M[8] = R3
R2 = R0
1 000 0001 0 RR MMMMM
1 000 0010 0 RR MMMMM
1 001 0001 0000 RR RR
Arithmetic and Logic Instructions:
Instruction:Example:Meaning:Machine Language Instruction:
ADD [REG1] [REG2] [REG3]
SUB [REG1] [REG2] [REG3]
AND [REG1] [REG2] [REG3]
OR [REG1] [REG2] [REG3]
ADD R3 R2 R1
SUB R3 R1 R0
AND R0 R3 R1
OR R2 R2 R3
R3 = R2 + R1
R3 = R1 - R0
R0 = R3 & R1
R2 = R2 | R3
1 010 0001 00 RR RR RR
1 010 0010 00 RR RR RR
1 010 0011 00 RR RR RR
1 010 0100 00 RR RR RR
Branching Instructions:
Instruction:Example:Meaning:Machine Language Instruction:
BRANCH [MEM]
BZERO [MEM]
BNEG [MEM]
BRANCH 10
BZERO 2
BNEG 7
PC = 10
PC = 2 IF ALU RESULT IS ZERO
PC = 7 IF ALU RESULT IS NEGATIVE
0 000 0001 000 MMMMM
0 000 0010 000 MMMMM
0 000 0011 000 MMMMM
Other Instructions:
Instruction:Example:Meaning:Machine Language Instruction:
NOP
HALT
NOP
HALT
Do nothing.
Halt the machine.
0000 0000 0000 0000
1111 1111 1111 1111