Here's a statistical breakdown of the source code for the Commodore 64 version of Elite. Click on the table headers to sort by that statistic. For more information, see the notes after the table.
Category | Instructions | Subroutines | Variables | Data (bytes) |
---|---|---|---|---|
Charts | 247Â Â Â (1.9%) | 9Â Â Â (1.6%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Copy protection | 19Â Â Â Â (0.1%) | 1Â Â Â (0.2%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Dashboard | 434Â Â Â (3.3%) | 23Â Â (4.2%) | 0Â Â Â Â (0.0%) | 6Â Â Â Â Â (0.0%) |
Drawing circles | 251Â Â Â (1.9%) | 10Â Â (1.8%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Drawing lines | 1014Â Â (7.8%) | 21Â Â (3.8%) | 13Â Â Â (3.1%) | 610Â Â Â (2.9%) |
Drawing pixels | 85Â Â Â Â (0.7%) | 4Â Â Â (0.7%) | 9Â Â Â Â (2.2%) | 607Â Â Â (2.9%) |
Drawing planets | 305Â Â Â (2.3%) | 15Â Â (2.7%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Drawing ships | 1081Â Â (8.3%) | 15Â Â (2.7%) | 37Â Â Â (8.9%) | 8699Â (41.7%) |
Drawing suns | 174Â Â Â (1.3%) | 6Â Â Â (1.1%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Drawing the screen | 328Â Â Â (2.5%) | 19Â Â (3.5%) | 14Â Â Â (3.4%) | 843Â Â Â (4.0%) |
Equipment | 229Â Â Â (1.8%) | 5Â Â Â (0.9%) | 1Â Â Â Â (0.2%) | 28Â Â Â Â (0.1%) |
Flight | 666Â Â Â (5.1%) | 29Â Â (5.3%) | 0Â Â Â Â (0.0%) | 1Â Â Â Â Â (0.0%) |
Keyboard | 474Â Â Â (3.6%) | 18Â Â (3.3%) | 4Â Â Â Â (1.0%) | 197Â Â Â (0.9%) |
Loader | 988Â Â Â (7.6%) | 30Â Â (5.5%) | 10Â Â Â (2.4%) | 800Â Â Â (3.8%) |
Main loop | 745Â Â Â (5.7%) | 22Â Â (4.0%) | 0Â Â Â Â (0.0%) | 2Â Â Â Â Â (0.0%) |
Market | 363Â Â Â (2.8%) | 17Â Â (3.1%) | 1Â Â Â Â (0.2%) | 68Â Â Â Â (0.3%) |
Maths (Arithmetic) | 864Â Â Â (6.6%) | 49Â Â (8.9%) | 4Â Â Â Â (1.0%) | 1024Â Â (4.9%) |
Maths (Geometry) | 345Â Â Â (2.6%) | 17Â Â (3.1%) | 2Â Â Â Â (0.5%) | 96Â Â Â Â (0.5%) |
Missions | 182Â Â Â (1.4%) | 13Â Â (2.4%) | 5Â Â Â Â (1.2%) | 36Â Â Â Â (0.2%) |
Moving | 545Â Â Â (4.2%) | 16Â Â (2.9%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Save and load | 241Â Â Â (1.8%) | 15Â Â (2.7%) | 9Â Â Â Â (2.2%) | 189Â Â Â (0.9%) |
Sound | 507Â Â Â (3.9%) | 45Â Â (8.2%) | 12Â Â Â (2.9%) | 200Â Â Â (1.0%) |
Sprites | 0Â Â Â Â Â (0.0%) | 0Â Â Â (0.0%) | 1Â Â Â Â (0.2%) | 7Â Â Â Â Â (0.0%) |
Stardust | 378Â Â Â (2.9%) | 7Â Â Â (1.3%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Start and end | 276Â Â Â (2.1%) | 9Â Â Â (1.6%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Status | 177Â Â Â (1.4%) | 7Â Â Â (1.3%) | 2Â Â Â Â (0.5%) | 66Â Â Â Â (0.3%) |
Tactics | 433Â Â Â (3.3%) | 14Â Â (2.5%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Text | 706Â Â Â (5.4%) | 63Â (11.5%) | 18Â Â Â (4.3%) | 5851Â (28.1%) |
Tube | 15Â Â Â Â (0.1%) | 2Â Â Â (0.4%) | 0Â Â Â Â (0.0%) | 0Â Â Â Â Â (0.0%) |
Universe | 861Â Â Â (6.6%) | 32Â Â (5.8%) | 2Â Â Â Â (0.5%) | 39Â Â Â Â (0.2%) |
Utility routines | 119Â Â Â (0.9%) | 17Â Â (3.1%) | 8Â Â Â Â (1.9%) | 6Â Â Â Â Â (0.0%) |
Workspaces | 0Â Â Â Â Â (0.0%) | 0Â Â Â (0.0%) | 263Â (63.4%) | 1467Â Â (7.0%) |
Totals | 13052 | 550 | 415 | 20842 |
Some notes on the above:
- The instruction count does not include EQUB, EQUW, EQUD, EQUS or SKIP operatives; these are counted as data even when they are buried in code (so EQUB &2C "BIT skip" instructions are counted as data, for example).
- INCBIN files are not included in the counts, so the data count doesn't include bytes from binary source files.
- Each part of a multi-part subroutine counts as an individual subroutine.
- The statistics are produced by a relatively simple static analysis of the source code. They are not 100% accurate, though they are pretty close.
- The totals cover all code in the project, including loaders, docked and flight code, Tube code and ship data files.