Skip to content

Commit

Permalink
Sunrise 45: Much more progress aligning.
Browse files Browse the repository at this point in the history
  • Loading branch information
thewonderidiot committed Nov 27, 2022
1 parent 575c713 commit 6e82092
Show file tree
Hide file tree
Showing 8 changed files with 992 additions and 1,458 deletions.
91 changes: 18 additions & 73 deletions Sunrise45/BANK_03_INTERPRETER_SECTION.agc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
## Assembler: yaYUL --block1
## Contact: Jim Lawton <jim DOT lawton AT gmail DOT com>
## Website: www.ibiblio.org/apollo/index.html
## Page Scans: www.ibiblio.org/apollo/ScansForConversion/Solarium055/
## Mod history: 2009-09-17 JL Created.
## 2009-09-22 JL Fixed typo.
## 2016-08-18 RSB Some corrections.
## 2016-12-28 RSB Proofed comment text using octopus/ProoferComments,
## and fixed errors found.

## Page 70
SETLOC 6000

BMN1 TC BRANCH # BRANCH MINUS
Expand Down Expand Up @@ -58,7 +56,6 @@ MINUS CAF ONE
AD BRANCHQ
XAQ

## Page 71

TRUE2 CS FIXLOC # RESTORES INTEGER ADDRESSES
AD ADDRWD
Expand Down Expand Up @@ -110,7 +107,6 @@ SXA TC TAG
CS A
TC STOR1

## Page 72

TIX TC TAG
INDEX TAG1 # GET APPROPRIATE STEP REGISTER
Expand Down Expand Up @@ -153,7 +149,6 @@ XAD TC TAG # INDEX REGISTER ADD FROM ERASABLE
COM
TC INCR +2

## Page 73

VDEF CAF ZERO
AD VACLOC # USES MPAC AS V0, PUSHES UP FOR V1, AND
Expand Down Expand Up @@ -201,7 +196,6 @@ SIGN INDEX ADDRWD # AFFIX SIGN OF X TO MPAC OR VAC
TC COMP
TC DANZIG

## Page 74

VSQ CS VACLOC # TAKE SQUARE OF LENGTH OF VECTOR IN VAC.
COM
Expand Down Expand Up @@ -234,7 +228,6 @@ SR14 XCH MPAC # SAVE REDUCED COUNT
TC SHIFTR +3 # NON-ZERO - BACK TO SHIFT LOOP
TC TEM5 # FINISHED

## Page 75

ABVAL1 TC ABVAL
TC DPEXIT # MODE IS NOW DP
Expand Down Expand Up @@ -276,7 +269,6 @@ SSP TC BRANCH
TC MPACCOM
TC DANZIG

## Page 76

SQUARE CAF BUGMPAC # SQUARE MPAC AND LEAVE RESULT IN MPAC, +2
TC DSQ2 # CONTINUE AS IN DMP.
Expand Down Expand Up @@ -318,7 +310,6 @@ NOLOAD CCS ADRLOC # NOLOD AND ROUND OPERATORS. DECREMENT
SWLODIND TS NEWEQIND
TC DANZIG

## Page 77

SL1 XCH MPAC +2 # ROUTINE WHICH SHIFTS TRIPLE ACCUMULATOR
DOUBLE # LEFT ONE PLACE. IT IS USED BY TSLT AND
Expand Down Expand Up @@ -365,21 +356,12 @@ SLCANS CS TEM2 # STORE COMPLEMENT OF COUNT
TS 0
TC DANZIG

## Page 78

SWITCHEM CS POLISH # SWITCH AND TEST INSTRUCTIONS.
TS ADDRWD # DECOMPOSE ADDRESS INTO SWITCH WORD AND
MASK SBITMASK # BIT. MULTIPLES OF 16 ARE EXCLUDED.
XCH ADDRWD
EXTEND
MP BIT11
TS TEM8 # 0, 1, OR 2.
SWITCHEM TC TRUE2 # SWITCH AND TEST INSTRUCTIONS.

INDEX ADDRWD # PICK UP A 1 IN SPECIFIED SWITCH POS.
CAF BIT15 -1 # SWITCHES ARE NUMBERED 1 - 15 D.
TS TEM4
INHINT
INDEX TEM8
MASK STATE # GET BS WHERE B IS BIT AND S IS *STATE*
TS TEM5 # - THE WORD CONTAINING THE 15 SWITCHES

Expand All @@ -389,25 +371,19 @@ SWITCHEM CS POLISH # SWITCH AND TEST INSTRUCTIONS.
CS TEM4
TC SWITCHIT # SWITCH BIT.

RELINT
CCS TEM5 # TEST SWITCH
TC RE-ENTER # IT WAS ON - DONT BRANCH
TC SWF/F # OFF - GO TO FIXED-FIXED TO PICK UP ADR.
TC RE-ENTER # COMES HERE IF BIT 15 WAS ON

SWITCHIT INDEX TEM8 # WE DESIRE THE LOGICAL EXCLUSIVE OR OF B
SWITCHIT XCH STATE # WE DESIRE THE LOGICAL EXCLUSIVE OR OF B
COM
MASK STATE
TS Q # SET THIS BIT TO OSO AD IS OR.
INDEX TEM8
CS STATE
MASK TEM4 # COMPLEMENT OF SWITCH BIT.
AD Q # OR
INDEX TEM8
AD TEM5
COM
TS STATE
RELINT
TC RE-ENTER # DONT PUSH-DOWN IF AT END.

## Page 79

VSLT2 TS MPAC +1 # SET TO ZERO IN CASE OF RIGHT SHIFT.
TC TRUE2 # RETURNS TO CALLER IF COUNT PNZ.
Expand Down Expand Up @@ -442,7 +418,6 @@ VSL1 INDEX TEM2
TS OVFIND
TC Q

## Page 80

# DOUBLE-PRECISION SINE-COSINE ROUTINES.
#
Expand Down Expand Up @@ -491,7 +466,6 @@ SINE XCH Q # CLOSED SINE ROUTINE
CS MPAC
TS VBUF +2

## Page 81

SN1 CS MPAC +1 # SAVE REST OF ARGUMENT
TS VBUF +3
Expand Down Expand Up @@ -530,7 +504,6 @@ SIN1 TC SINE # INTERPRETER LINKAGE
COS1 TC COSINE
TC DANZIG

## Page 82

ARCSIN CAF TCTAG+1 # PICK UP ARCSIN BRANCH
AD POSMAX # TO FORCE OVERFLOW
Expand All @@ -540,8 +513,7 @@ ARCCOS CAF TCEX # SET ARCCOS SWITCH
XCH ESCAPE # NO SKIP, PLEASE
XCH Q # ONLY HAVE TO SAVE Q IN ONE PLACE
TS ARETURN
TC TPAGREE # FORCE SIGN AGREEMENT SO WE CAN CHECK
CCS A # SIZE OF ARGUMENT (SIGNUM RETURNS IN A).
TC BRANCH
TC ACOSST # POSITIVE
TC +2 # ARCCOS = PI/2
TC NEGARGU
Expand All @@ -554,15 +526,14 @@ ACOSST TC PARTSL1 # DOUBLE ARGUMENT
XCH MPAC # NO SKIP, BUT EXAMINE ORIGINAL MPAC
AD NEG1/2 # MUST BE LESS THAN OR EQUAL TO 1/2
CCS A
TC ABORT # MAJOR PART GREATER THAN 1/2. NOTE THAT
OCT 01301 # MPAC+1 IS NOT CHECKED SO A MARGIN EXISTS
TC # MAJOR PART GREATER THAN 1/2. NOTE THAT
LOC +1 # MPAC+1 IS NOT CHECKED SO A MARGIN EXISTS

TC +4 # NORMAL CASE
TS MPAC # ARGUMENT WAS 1 (SCALED). LEAVE ZERO
TS MPAC +1 # AS RESULT AND EXIT
TC ESCAPE

## Page 83

+4 CS MPAC +1
TS MPAC +1
Expand All @@ -589,7 +560,6 @@ ACOSST TC PARTSL1 # DOUBLE ARGUMENT
CS B
XCH MPAC
TS B
## Page 84
TC POLY # EVALUATE HASTINGS POLYNOMIAL/2PI
DEC 14
2DEC* .4999999920 B-1* # HASTINGS COEFFICIENTS/2PI
Expand Down Expand Up @@ -621,7 +591,6 @@ NEGARGU TC DACCOM # ARCCOS(-X)=PI-ARCCOS(X)
TS ESCAPE2 # ADDITIONAL SWITCH HERE.
TC ACOSST

## Page 85

SUBTR CS MPAC
AD HALF
Expand Down Expand Up @@ -649,7 +618,6 @@ DACCOM+ CS MPAC +1 # USED BY SIN-COS AND ARCSIN-ARCCOS
TS MPAC
TC Q

## Page 86

MBXCH XCH BUF # TO EXCHANGE MPAC AND BUF
XCH MPAC
Expand Down Expand Up @@ -691,7 +659,6 @@ DDVOK CAF ZERO
AD MPAC
TC DPDNORT # TO NORMALIZE

## Page 87

SQRTDIV XCH Q # ENTRY FROM SQRT ROUTINE
TS TEMQ3
Expand All @@ -717,7 +684,6 @@ DPDNORT TS CYL # TO LOOK AT BIT 14
TS MPAC
TC DPDNORT # AND TRY AGAIN

## Page 88

DVSTART XCH BUF # OK
INDEX OPOVF
Expand Down Expand Up @@ -752,7 +718,6 @@ DVSTART XCH BUF # OK
INDEX OPOVF
DV MPAC

## Page 89

DPDSGNT TS MPAC +1
CCS TEM2
Expand All @@ -767,16 +732,11 @@ POSQUOT XCH OVCTR
TC -3

DPDOFLO CCS TEM2
CAF TWO
AD NEG1
CS TWO
AD ONE
TS OVFIND
EXTEND # SET MPAC = +- POSMAX
MP POSMAX
XCH LP
TS MPAC +1
TC POSQUOT -2
TC TEMQ3

## Page 90

TSGNABS XCH Q # SIGNUM AND ABSOLUTE VALUE
TS TEMQ2
Expand Down Expand Up @@ -811,7 +771,6 @@ SGN=+ CAF POSMAX
TS SGNDMAX
CAF ONE

## Page 91

SGFORCE AD MPAC +2
AD SGNDMAX
Expand All @@ -826,10 +785,9 @@ SGFORCE AD MPAC +2
AD MPAC
AD SGNDMAX
TS MPAC
SBITMASK OCT 17
LOC +1
TC TEMQ

## Page 92

UNIT TC ABVAL # UNIT VECTOR ROUTINE - START BY GETTING
# LENGTH
Expand Down Expand Up @@ -879,7 +837,6 @@ UNITLOOP TS COMPON
TC 8TO2
TC DANZIG

## Page 93

UNITRUPT CS BANKSET # REQUESTS FOR INTERPRETIVE INTERRUPT
TS MPAC +2 # COME HERE DURING THE UNIT OPERATION.
Expand Down Expand Up @@ -913,7 +870,6 @@ SR1 TS TEM11 # SHIFTS RIGHT ONE USING ADDRESS IN A
TS 1
TC Q

## Page 94

SQRT2 CAF ZERO # ENTRY TO IGNORE C(MPAC+2)
TS MPAC +2
Expand All @@ -924,27 +880,20 @@ SQRT3 XCH Q # HERE TO TREAT TRIPLE-PRECISION CASES
CCS A # TEST SIGNUM
TC SETNORM # PNZ - OK.
TC TEMQ2 # FAST EXIT FOR ZERO ARGUMENT
CCS MPAC # IF ARGUMENT WAS NEGATIVE BUT MAJOR PART

TC ABORT # (MPAC IS NEGATIVE) IS ZERO, ANSWER IS
OCT 01302 # TAKEN AS ZERO WITH NO FURTHER ACTION.
TC -2 # IF NON-ZERO, IT IS ASSUMED A TRANSIENT
# ERROR HAS PRODUCED THE BAD DATA.

TS MPAC +1 # ARGUMENT NEGATIVE BUT MORE THAN -10-4.
TC TEMQ2 # SET MPAC,+1 TO ZERO AND EXIT.
TC # FIXME

SETNORM TS ADDRWD # SET NORMALIZATION COUNT TO ZERO
CS MPAC
AD MPAC
TS CYL # WE WILL USE A/2, SO MUST CHECK FOR
CCS CYL # NORMALIZATION FIRST
TC MPACSR1 # NORMALIZED - SHIFT RIGHT ONE.
TC ARGHI

TC SRTEST # LESS THAN 1/2 - SEE IF AT LEAST 1/8.

TC A0=0 # MAJOR PART (POSSIBLY MINOR PART) = 0.

TC MPACSR1 # NORMALIZED - SHIFT RIGHT ONE.

TC ARGHI

SRTEST AD -1/2+2 # SEE IF ARG GREATER THAN OR EQUAL TO 1/4.
CCS A
TC MPACSR1 # IT IS - SHIFT RIGHT ONE AND GO TO ARGLO.
Expand All @@ -954,7 +903,6 @@ SRTEST AD -1/2+2 # SEE IF ARG GREATER THAN OR EQUAL TO 1/4.
# BY SHIFTING LEFT ONLY ONCE WHEN ADDING
# ONE TO THE RIGHT SHIFT COUNT.

## Page 95

A0=0 XCH MPAC +2 # MOVE ARGUMENT UP
XCH MPAC +1
Expand All @@ -971,7 +919,6 @@ SQRTNORM TC SL1
TS CYL
CS CYL

## Page 96

NORMTEST CCS CYL
CCS CYL
Expand Down Expand Up @@ -1013,7 +960,6 @@ ARGHI CAF SLOPEHI
MP HALF
AD MPAC
TS OVCTR # AND MAYBE SKIP, IF ARG WAS NEAR POSMAX
## Page 97
TC +4 # IF NO OVERFLOW
CAF POSMAX
TS MPAC +1
Expand Down Expand Up @@ -1043,7 +989,6 @@ SQRTS CS MODE # INTERPRETER LINKAGE
TC SQRT3
TC DANZIG

NEG13 EQUALS MINUS13
DMOVE EQUALS DANZIG # LOADING ONLY
VMOVE EQUALS DANZIG
TMOVE CS TWO # SET MODE TO TRIPLE FOR TP OPERATIONS
Expand Down
14 changes: 7 additions & 7 deletions Sunrise45/DOWN-TELEMETRY_PROGRAM.agc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ DOWNRUPT CCS TELCOUNT # PNZ IS NORMAL SETTING - +0 INDICATES

DOWNTMOK TS TELCOUNT # NORMAL MODE - STORE DECREMENTED COUNT.

DWNRELAY CCS DISPBUF
CCS DISPBUF
TC +2
TC DWNKEY
TC CHARTEST

CAF ZERO
XCH DISPBUF
Expand All @@ -49,17 +49,17 @@ DATADWNF TS OUT4
TS OUT1
TC NBRESUME # NO BANK SWITCH REQUIRED.

DWNKEY CCS TMKEYBUF
CHARTEST CCS TMKEYBUF
TC +2
TC DWNID
TC DATA/ID

CAF ZERO
XCH TMKEYBUF
TC DATADWNF

DATADWN CCS IDPLACER
DATA/ID CCS IDPLACER
TC +2
TC DWNID
TC IDNEXT

TS IDPLACER
CCS TMINDEX
Expand All @@ -78,7 +78,7 @@ DATADWN CCS IDPLACER
TS OUT1
TC NBRESUME

DWNID AD TMINDEX
IDNEXT AD TMINDEX
TS OUT4
CAF FOUR
TS IDPLACER
Expand Down
2 changes: 1 addition & 1 deletion Sunrise45/EXTENDED_VERBS_FOR_MODING.agc
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ GOLOADLV TC BANKCALL
CADR FLASHOFF
TC XACT0
TC POSTJUMP
CADR LOADLV1
CADR LOADLV

## Page 250

Expand Down
Loading

0 comments on commit 6e82092

Please sign in to comment.