Add README.md
[pdp8.git] / sw / f4 / FRTSRC / amin.ra
1 /
2 / VERSION 5A 4/27/77 MH
3 /
4 SECT AMIN0
5 ENTRY AMIN1
6 ENTRY MIN0
7 ENTRY MIN1
8 BASE 0
9 AMIN1, SETX XR
10 LDX 1,3 /DON'T INTEGERIZE RESULT
11 MINCOM, STARTD
12 FLDA 0 /ADDRESS OF JA .+2+2*N
13 FSTA 3
14 FLDA 30 /RETURN ADDRESS
15 FSTA RETN
16 FLDA% 3 / JA .+2+2*N
17 FSUB 0 /-JA .
18 FSUB TWO /- 2
19 LDX 1,1
20 ALN 1 /DIVIDE BY TWO
21 FNEG /-N
22 ATX 1
23 LDX 0,2 /FOR ARG PICKUP
24 FLDA% 0,2+ /ADDRESS OF FIRST ARG
25 FSTA 3
26 STARTF
27 NEW, FLDA% 3 /SAVE NEW MIN
28 FSTA MIN
29 SAME, JXN MORMIN,1+ /ANY MORE ARGS ?
30 FLDA MIN /GET RESULT
31 JXN RETN,3 /DON'T FIX
32 JLT NEGFIX /NEGATIVE FIX
33 ALN 0
34 FNORM
35 JA RETN
36 NEGFIX, FNEG
37 ALN 0
38 FNORM
39 FNEG
40 RETN, JA .
41 MORMIN, STARTD /NEXT ARG ADDRESS
42 FLDA% 0,2+
43 FSTA 3
44 STARTF
45 FLDA MIN /COMPARE
46 FSUB% 3
47 JLE SAME /SAME MIN
48 JA NEW /NEW MIN
49 TWO, 0;2
50 MIN, 0;0;0
51 MIN0,
52 MIN1, SETX XR
53 LDX 0,3 /INTEGERIZE RESULT
54 JA MINCOM /GO DO IT
55 XR, 0;0;0;0;0;0;0;0
56 END
57 \f