Source Code
These source-code files were transcribed from the attachment of issue #13 of the
AGC Information Series, "YUL Programming System" (1963). It is a tiny sample Block I
AGC program for demonstrating the usage of the YUL assembler, as well as the
encoding of the punch cards, and the error handling of the assembler.
Scans of the assembly listing of the program can be found at the Virtual AGC project website, and the full document can be found in the Virtual AGC document library. Notations on the program listing read: ASSEMBLE NEW AGC4 PROGRAM TRIVIUM BY IMA NIT-PICKER |
000015,000002: ## Copyright: Public domain.
000016,000003: ## Filename: 1_AND_ONLY.agc
000017,000004: ## Purpose: Source code for TRIVIUM, a demonstration
000018,000005: ## Block I AGC program for the YUL assembler.
000019,000006: ## Assembler: yaYUL
000020,000007: ## Contact: Ron Burkey <info@sandroid.org>.
000021,000008: ## Website: https://www.ibiblio.org/apollo/index.html
000022,000009: ## Page Scans: http://www.ibiblio.org/apollo/ScansForConversion/TRIVIUM/
000023,000010: ## Pages: 1
000024,000011: ## Mod history: 2018-10-20 RSB Created.
000025,000012:
Page 1 |
000027,000014:
000028,000015: # CANONICAL PROBLEM FOR AGC4: TO PLACE IN REGISTER HOUSTON THE NUMBER OF ONES IN REGISTER HUNTSVIL, USING
000029,000016: # THE LEAST NUMBER OF LOCATIONS AND ASSUMING THAT NO REGISTERS NEED BE SAVED. THIS SOLUTION, REQUIRING 10 IN-
000030,000017: # STRUCTIONS AND TWO CONSTANTS, IS THE BEST KNOWN TO DATE.
000031,000018:
000032,000019:
000033,000020: # MISCELLANEOUS DEFINITIONS AND CONSTANTS HERE. ENTER ROUTINE AT WERNER.
000034,000021:
000035,000022: ??????? LP = 3
000036,000023: ??????? HOUSTON EQUALS 14
000037,000024:
000038,000025: 5776 SETLOC 5776
000039,000026:
000040,000027: 5776 00001 ONE OCT 1
000041,000028: 5777 47777 4 7777
000042,000029:
000043,000030:
000044,000031: 5510 SETLOC 2888D
000045,000032:
000046,000033: 5510 35776 WERNER CAF ONE
000047,000034: 5511 25777 EXTEND # NOTICE THAT THIS IS INDEX 5777.
In the original program, the variable HUNTSVIL is not defined, thus generating an error at assembly-time and demonstrating YUL's error handling. Various oddities in columnar alignment (pointed out where they appear below) are not treated as errors, and are presumably present to demonstrate that fact. |
Fatal Error: Symbol "HUNTSVIL" undefined or offset bad
000052,000039: 5512 40000 MP HUNTSVIL # ZERO TO A, C(HUNTSVIL) TO LP.
000053,000040:
In the following line, note the peculiar alignment of the label VON. This was not an error for the original assembler, YUL, but is an error for the modern assembler, yaYUL. |
000056,000043: 5513 50014 TS HOUSTON # ZERO COUNT (INITIALLLY), ACCUMULATE COUNT
000057,000044: # (SUBSEQUENTLY).
000058,000045: 5514 10003 CCS LP # EXAMINE AND CLEAR BIT 15 (FIRST TIME).
000059,000046: # SUBSEQUENTLY, DO BITS 1-14 IN ORDER.
In the following line, notice the unusual alignment of the TC opcode. This was not an error for the original assembler, YUL, but is an error for the modern assembler, yaYUL. |
Fatal Error: Operand "TC" not resolved.
000063,000050: 5515 00000 TC -1 # IF BIT=0 BUT C(LP) NON-ZERO, LOOK AGAIN.
000064,000051: 5516 05522 TC BRAUN +1 # EXIT WHEN C(LP) EXHAUSTED.
000065,000052: 5517 30014 XCH HOUSTON # SET UP INCREMENT IF BIT=1.
In the following line, notice the misalignment of the constant ONE. This was not an error for the original assembler, YUL, nor for the modern assembler, yaYUL. |
000068,000055: 5520 65776 AD ONE # C(LP) CAN BE -0 FIRST TIME ONLY.
Fatal Error: Symbol "VON" undefined or offset bad
000069,000056: 5521 00000 BRAUN TC VON
End of include-file 1_AND_ONLY.agc. Parent file is MAIN.agc