Knob & Switch Computer Company
K & S Model 1 - 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
1000 0000 00 RR MMMM
0100 0000 00 MMMM RR
1100 0000 00 00RR RR
Arithmetic and Logic Instructions:
Instruction:Example:Meaning:Opcode:
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
0000 1000 00 RR RR RR
0000 0100 00 RR RR RR
0000 1100 00 RR RR RR
0000 0010 00 RR RR RR
Branching Instructions:
Instruction:Example:Meaning:Opcode:
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
0000 0000 10 00 MMMM
0000 0000 01 00 MMMM
0000 0000 11 00 MMMM
Other Instructions:
Instruction:Example:Meaning:Opcode:
NOP
HALT
NOP
HALT
Do nothing.
Halt the machine.
0000 0000 0000 0000
1111 1111 1111 1111