Add README.md
[pdp8.git] / sw / f4 / FRTSRC / cabs.ra
CommitLineData
7af5ad59
PH
1/
2/ C A B S
3/ - - - -
4/
5/ VERSION 5A 4-27-77 PT
6/
7/ENTER IN COMPLEX, EXIT IN REAL
8/
9/Z=X+IY
10/
11/CABS(Z)=SQRT(X^2+Y^2)
12/
13 DPCHK
14 SECT CABS
15 JA #CABS
16 TEXT +CABS +
17CABSXR, SETX XRCABS
18 SETB BPCABS
19 JA .+3
20BPCABS, F 0.0
21XRCABS, F 0.0
22ARG, F 0.0
23 F 0.0
24 ORG 10*3+BPCABS
25 FNOP
26 JA CABSXR
27 0
28CABSRT, JA .
29 BASE 0
30#CABS, STARTD
31 FLDA 10*3
32 FSTA CABSRT
33 FLDA 0
34 SETB BPCABS
35 SETX XRCABS
36 BASE BPCABS
37 LDX 1,1
38 FSTA BPCABS
39 FLDA% BPCABS,1
40 FSTA BPCABS
41 STARTE
42 FLDA% BPCABS
43 FSTA ARG
44 STARTF
45 FLDA ARG
46 FMULM ARG /X^2
47 FLDA ARG+3 /Y
48 FMUL ARG+3 /Y^2
49 FADD ARG /X^2+Y^2
50 FSTA ARG
51 EXTERN SQRT
52 JSR SQRT
53 JA RT1
54 JA ARG
55RT1, JA CABSRT
56 EXTERN #CAC
57\f