Code: Select all
LBL "VEKTOR"
FIX 2
SF 27
SF 28
"C- C+ C* C/"
PROMPT
LBL A ; "CSUB"
CHS
X<>Y
CHS
X<>Y ; 1981 fix
LBL B ; "CADD"
X<>Y
RDN
+
RDN
+
R^
GTO 08 ; display UV
LBL D ; "CDIV"
R-P
1/X
X<>Y
CHS
GTO 10
LBL C ; "CMULT"
R-P
X<>Y
LBL 10
RDN
RDN
R-P
R^
*
RDN
+
R^
P-R
LBL 08
"U="
ARCL X
"|-, V="
ARCL Y
AVIEW
END
Changes (among others): local instead of global label, R00->R10
This program does substract, add, multiply or devide two vectors.
Usage:
Arithmetic-Keys: A=C- B=C+ C=C* D=C/
Stack: X:U2 Y:V2 Z:U1 T:V1
The two vectors are denoted by: U1+iV1 and U2+iV2
Example:
Add 1+i2 to 4+i6
input: 6 enter 4 enter 3 enter 1 <B>
Display: U=5.00, V=9.00