Source Code

This source code is a "repaired" version of TRIVIUM, a tiny sample Block I AGC program for demonstrating the usage of the YUL assembler. The "repair" removes both intentional errors in the original program, and unintended problems that were not errors for the original YUL, but are errors or bad practice for the modern assembler, yaYUL.

000017,000002:                                                                                                  ## Copyright:   Public domain.
000018,000003:                                                                                                  ## Filename:    1_AND_ONLY.agc
000019,000004:                                                                                                  ## Purpose:     Source code for TRIVIUM, a demonstration
000020,000005:                                                                                                  ##              Block I AGC program for the YUL assembler,
000021,000006:                                                                                                  ##              with the intentional and unintended coding
000022,000007:                                                                                                  ##              errors repaired.
000023,000008:                                                                                                  ## Assembler:   yaYUL
000024,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
000025,000010:                                                                                                  ## Website:     https://www.ibiblio.org/apollo/index.html
000026,000011:                                                                                                  ## Page Scans:  http://www.ibiblio.org/apollo/ScansForConversion/TRIVIUM/
000027,000012:                                                                                                  ## Pages:       1-1
000028,000013:                                                                                                  ## Mod history: 2018-10-20 RSB  Created.
000029,000014: 

Page 1

000031,000016: 
000032,000017:                                                                                                  #           CANONICAL PROBLEM FOR AGC4: TO PLACE IN REGISTER HOUSTON THE NUMBER OF ONES IN REGISTER HUNTSVIL, USING
000033,000018:                                                                                                  #  THE LEAST NUMBER OF LOCATIONS AND ASSUMING THAT NO REGISTERS NEED BE SAVED.  THIS SOLUTION, REQUIRING 10 IN-
000034,000019:                                                                                                  #  STRUCTIONS AND TWO CONSTANTS, IS THE BEST KNOWN TO DATE.
000035,000020: 
000036,000021: 
000037,000022:                                                                                                  #  MISCELLANEOUS DEFINITIONS AND CONSTANTS HERE.  ENTER ROUTINE AT WERNER.
000038,000023: 
000039,000024: ???????                        LP                 =        3                                     
000040,000025: ???????                        HOUSTON            EQUALS   14                                    

The following line was not present in the original program.

000042,000027: ???????                        HUNTSVIL           EQUALS   15                                    
000043,000028: 
000044,000029:    5776                                           SETLOC   5776                                  
000045,000030: 
000046,000031:    5776           00001        ONE                OCT      1                                     
000047,000032:    5777           47777                           4        7777                                  
000048,000033: 
000049,000034: 
000050,000035:    5510                                           SETLOC   2888D                                 
000051,000036: 
000052,000037:    5510           35776        WERNER             CAF      ONE                                   
000053,000038:    5511           25777                           EXTEND                                         #  NOTICE THAT THIS IS INDEX 5777.
000054,000039:    5512           40015                           MP       HUNTSVIL                              #  ZERO TO A, C(HUNTSVIL) TO LP.
000055,000040: 

The label VON was misaligned in the original program.

000057,000042:    5513           50014        VON                TS       HOUSTON                               #  ZERO COUNT (INITIALLLY), ACCUMULATE COUNT
000058,000043:                                                                                                  #   (SUBSEQUENTLY).
000059,000044:    5514           10003                           CCS      LP                                    #  EXAMINE AND CLEAR BIT 15 (FIRST TIME).
000060,000045:                                                                                                  #  SUBSEQUENTLY, DO BITS 1-14 IN ORDER.

The opcode TC was misaligned in the original program.

000062,000047:    5515           05514                           TC       -1                                    #  IF BIT=0 BUT C(LP) NON-ZERO, LOOK AGAIN.
000063,000048:    5516           05522                           TC       BRAUN      +1                         #  EXIT WHEN C(LP) EXHAUSTED.
000064,000049:    5517           30014                           XCH      HOUSTON                               #  SET UP INCREMENT IF BIT=1.

The operand ONE was misaligned in the original program.

000066,000051:    5520           65776                           AD       ONE                                   #  C(LP) CAN BE -0 FIRST TIME ONLY.
000067,000052:    5521           05513        BRAUN              TC       VON                                   

End of include-file 1_AND_ONLY.agc.  Parent file is MAIN.agc