Add README.md
[pdp8.git] / sw / f4 / FRTSRC / amod.ra
CommitLineData
7af5ad59
PH
1/
2/
3/
4/ A M O D
5/ - - - -
6/
7/SUBROUTINE AMOD(X,Y)
8/
9/ VERSION 5A 4-27-77 PT
10/
11 SECT AMOD
12 ENTRY MOD
13 JA #AMOD
14 TEXT +AMOD +
15AMODXR, SETX XRAMOD
16 SETB BPAMOD
17BPAMOD, F 0.0
18XRAMOD, F 0.0
19AMODX, F 0.0
20 ORG 10*3+BPAMOD
21 FNOP
22 JA AMODXR
23 0
24 AMDRTN, JA .
25 EXTERN #ARGER
26AMODER, TRAP4 #ARGER
27 FCLA
28 JA AMDRTN
29 BASE 0
30MOD,
31#AMOD, STARTD
32 FLDA 10*3
33 FSTA AMDRTN
34 FLDA 0
35 SETX XRAMOD
36 SETB BPAMOD
37 BASE BPAMOD
38 LDX 1,1
39 FSTA BPAMOD
40 FLDA% BPAMOD,1 /ADDR OF X
41 FSTA AMODX
42 FLDA% BPAMOD,1+ /ADDR OF Y
43 FSTA BPAMOD
44 STARTF
45 FLDA% BPAMOD /GET Y
46 JEQ AMODER /Y=0 IS ERROR
47 JGT .+3
48 FNEG /ABS VALUE
49 FSTA BPAMOD
50 FLDA% AMODX /GET X
51 JGT .+5
52 FNEG /ABS VALUE
53 LDX 0,1 /NOTE SIGN
54 FSTA AMODX /SAV IN A TEMPORARY
55 FDIV BPAMOD /DIVIDE BY Y
56 JAL AMODER /TOO BIG.
57 ALN 0 /FIX IT UP NOW.
58 FNORM
59 FMUL BPAMOD /MULITPLY IT.
60 FNEG /NEGATE IT.
61 FADD AMODX /AND ADD IN X.
62 JXN AM,1 /CHECK SIGN
63 FNEG
64AM, JA AMDRTN
65\f