UNARY OPERATIONS


Back to:
index table

NOT instruction

Coding:
bin: MOD1110 0001OP
hex: MOD E 1 OP
(MOD - modifier: affects on operands type - word/byte;OP - operand)

Description:
not OP ==> OP
This instruction applies logical operation NOT (0 changes to 1 and vice versa) to OP and writes the result back to OP. Flags N and Z are set according to the result.

Examples:
0E12 not R2 ==> R2 the R3 value will be inverted and stored to R2
0E16 not (R2) ==> (R2) instruction will invert the value of memory cell, which address stores in R2

Back to:
index table top


PUSH instruction

Coding:
bin: 00001110 0010OP
hex: 0 E 2 OP
(OP - operand)

Description:
OP ==> stack
This instruction places OP to stack (OP is always word!). Flags N and Z are set accoring to OP.

Examples:
0E20 R0 ==> stack the R0 valur will be saved in stack

Back to:
index table top


POP instruction

Coding:
bin: 00000011 0011OP
hex: 0 E 3 OP
(OP - operand)

Description:
stack ==> OP
This instruction restores OP from stack (OP is always word!). Flags N and Z are set accoring to OP value.

Examples:
0E30 stack ==> R0 the R0 valur will be loaded from stack

Back to:
index table top


ADD SP instruction

Coding:
bin: 00001100 0100OP
hex: 0 E 4 OP
(OP - operand)

Description:
SP + OP ==> SP
This instruction adds OP to SP register. Flags N and Z are set accoring to result.

Examples:
0E40 SP + R0 ==> SP SP will be increased by R0 value
0E4D
0010
SP + 10 ==> SP this instruction will increase SP value by constant 10

Back to:
index table top


SUBTRUCT SP instruction

Coding:
bin: 00001110 0101OP
hex: 0 E 5 OP
(OP - operand)

Description:
SP - OP ==> SP
This instruction subtracts OP from SP register. Flags N and Z are setting according to result.

Examples:
0E50 SP - R0 ==> SP SP will be dereased by R0 value

Back to:
index table top


MOVE TO SP instruction

Coding:
bin: 00001110 0110OP
hex: 0 E 6 OP
(OP - operand)

Description:
OP ==> SP
This instruction moves OP to SP register. Flags N and Z are set accoring to result.

Examples:
0E60 R0 ==> SP R0 value will be placed to SP
0E6D
00F0
00F0 ==> SP this instruction makes SP equal to 00F0 - constant from the second word of instruction

Back to:
index table top


MOVE FROM SP instruction

Coding:
bin: 00001110 0111OP
hex: 0 E 7 OP
(OP - operand)

Description:
SP ==> OP
This instruction moves a value from SP register to OP. Flags N and Z are set accoring to result.

Examples:
0E70 SP ==> R0 SP value will be placed to R0

Back to:
index table top


PUSH PS instruction

Coding:
bin: 00001110 10000000
hex: 0 E 8 0

Description:
PS ==> stack
This exotic instruction places the value from the processor status register PS to stack. It may be used to save the results of comparison for later analysis.

Examples:
0E80 PS ==> stack processor status register will be saved to stack

Back to:
index table top


POP PS instruction

Coding:
bin: 00001110 10010000
hex: 0 E 8 0

Description:
stack ==> PS
This instruction restores PS from stack. Flags N and Z are set according to this PS value.

Examples:
0E90 stack ==> PS the PS value will be loaded from stack

Back to:
index table top


SHIFTS

Shifts are also unary operations, but they are placed to a separate topic.

Back to:
index table top