Q-Code User Manual
Ver. 7.0 2021/11/30
128
4
Q-Code
Command
Q-Code
provides 4-bit commands and 8-bit commands. The RAM used by 4-bit commands is
Ri
, and the RAM
used by 8-bit commands is
Xi
.
Xi is composed by two 4-bit RAM, the corresponding method is shown below.
X(i) = [X(i)L, X(i)H] = [ R(i*2), R(i*2+1)
]
Ex.
X10 = [R20, R21]
, where R20 / X10L is the low-nibble of X10, and R21 / X10H is the high-nibble of X10.
Please refer to
5.6 Corresponding table of Ri and Xi
Note:
1. NY9T001A/004A do not provide 8-bit multiplication and division.
2. NX1 do not predefine Ri / Xi variables, user should declare needed variables in [Variable] section.
4.1 Arithmetic Logic Command
Arithmetic Logic Command
-
-
4.1.1 Variable Operation
Q-Code
supports the assignments and operations of variables. The variable can be:
1-bit operand: Ri.n / Xi.n / Pin
4-bit operand: Ri / Port
8-bit operand: Xi
Varaibles defined in
[Variable]
System variables
Supported variable operations are listed below.
No.
Variables
Note
Example
1
Var1 = Var2
Assignment operation
R0 = 0x4, R0 = R1,
R0 = RandomL, R0 = RandomH
2
Var1 = Var2 + Var3
Addition
R2 = R0 + 5,
R2 = 5 + R0
3
Var1 = Var2 – Var3
Subtraction
R2 = R0 – 3,
R2 = 5 – R0