NY6 User Manual
Ver 1.3 2019/03/28
62
4.2 Instruction Descriptions
4.2.1 Arithmetic Instructions
ADDM m
Function : Add M to ACC with Carry and the result is
saved back to ACC.
Operation : { C, ACC
} ← ACC +
M + C
Operand: m: 6-bit address of register or SRAM to
ADD, 0x00 to 0x3F
Words : 1
Cycles : 1
Operative Flags: C
Flags Affected: C, Z
Example :
ADDM m0
Before Instruction
ACC=0x7, [m0]=0xA, C=0
After Instruction
ACC=0x1, [m0]=0xA, C=1, Z=0
SUBM m
Function : Subtract M of address m from ACC with
Borrow, i.e. The (B) quantity effectively
implements a borrow capability for multi-
precision subtractions.
Operation : { C, ACC } = ACC - m - (~B)
Operand : m: 6-bit address of register or SRAM to
subtract with, 0x0 to 0x3F
B: 1-bit borrow flag data, shared with carry flag,
B=~C.
Words : 1
Cycles : 1
Operative Flags: C
Flags Affected: C, Z
Example :
SUBM m0
Before Instruction
ACC=0xA, [m0]=0x2, C=1
After Instruction
ACC=0x8, [m0]=0x2, Z=0, C=1
INCM m
Function: Add 1 to M of address m, and save the
result back to M.
Operation:{ C, M }
← M + 1
Operand: m: 6-bit address of register or SRAM to
increase, 0x00 to 0x3F
Words: 1
Cycles: 1
Operative Flags: C
Flags Affected: C, Z
Example:
INCM m0
Before Instruction
[m0]=0x0
After Instruction
[m0]=0x1, C=0, Z=0
DECM m
Function: Subtract 1 from M of address m, and save
the result back to M.
Operation: { C, M }
← M
- 1
Operand: m: 6-bit address of register or SRAM to
decrease, 0x00 to 0x3F
Words: 1
Cycles:
1
Operative Flags: None
Flags Affected: C, Z
Example:
DECM m0
Before Instruction
[m0]=0x0
After Instruction
[m0]=0xF, C=0, Z=0