# <addr> <name> [# comment]   addr = code offset in segment 0000, or ds:XXXX in data segment 0b00
0215 keyboard_isr  # port 60h -> ds:020d table, ds:0d2f key
4a99 timer_isr
4a50 timer_tick  # 45de, 45e0 (32-bit frame clock), 45e4 countdown, sound
0000 entry  # set stack, resize memory, hook ctrl-break/crit, check DOS, seed RNG, init, ret into 1415
00b3 restart_main  # mov [0000],sp; jmp title_loop (abort target)
1415 init_screens  # first-time init, returns to restart_main
30dc clear_screen  # EGA planar / MCGA a000 + back buffer
02e8 set_key_map  # copy 12-byte key map row ds:031f+12*n to ds:030d
03c0 command_loop  # keys -> command handlers through ds:0399
5e0f twist  # w0,w1,w2 <- w1,w2,w0+w1+w2
5e25 load_galaxy_seed  # ds:5509 + 6*galaxy(ds:8315) -> ds:5503
5e4d chart_to_screen
5e95 seed_to_chart  # chart cursor ds:8318/8319 from the current seed
5ee8 system_data  # nearest system to cursor, distance, then government..radius, name
5fe1 find_nearest_system
6047 system_distance  # -> ds:8343 (light years * 40)
608f show_system_name_distance
610e galaxy_step  # load galaxy seed, cx * 4 twists
6124 twist4
6130 planet_name  # -> ds:8338, length ds:8341
6f91 word_to_digits  # ax -> ascii at di using divisors ds:8016
6fbc blank_leading_zeros
8880 data_on_system  # screen: economy, government, tech, population, species, productivity, radius
9e80 title_loop  # rotating ships until a key
a027 flight_loop
ds:0000 saved_sp
ds:0202 bios_video_mode
ds:0205 rng_state  # 4 words, see NOTES
ds:030d key_map  # 12 bytes, current screen
ds:0319 key_pressed
ds:0399 command_table
ds:107a vec_draw_char
ds:107c vec_hspan
ds:107e vec_hspan2
ds:5503 seed  # 3 words
ds:5509 galaxy_seeds  # 8 x 3 words
ds:5585 digrams
ds:8315 galaxy
ds:8338 system_name
ds:8345 sys_government
ds:8346 sys_economy
ds:8347 sys_tech
ds:8348 sys_population
ds:8349 sys_species
ds:834d sys_productivity
ds:834f sys_radius
ds:8351 sys_desc_seed
ds:b1bb title_ship_type
31f6 load_grf  # reads ELITE.GRF, then picks the protection question (one RNG step)
32b8 pick_protection_question
0d9d input_word
03ad protection_target  # first word overwritten with c3 00 (ret) after the protection prompt
ds:09d9 protection_hash
ds:0a83 protection_page
ds:5070 protection_records
632b describe_system  # expand ds:5a35 into ds:5a3e and draw it word-wrapped
6396 print_text  # control codes 1..6 via ds:5b3e, tokens >= 80h via ds:5b4a
6401 text_system_name
6414 text_system_adjective
6446 text_random_name
6496 desc_random
64a5 name_to_scratch  # ds:8338 -> "Xxxx " at ds:63f2
8dd1 terminate_name  # 0 at ds:8338 + [ds:8341]
ds:5a34 text_caps
ds:5a35 desc_template
ds:5a3e desc_buffer
ds:5b3e text_codes
ds:5b4a desc_tokens
ds:8341 system_name_len
72f0 arrive_in_system  # copy selected system record to the current one, clear market flag
8e6b sell_price
8ea2 draw_market_table
9048 market_screen
9161 equipment_list
97d8 market_prices
9880 market_random
ds:831f current_system  # record copied from ds:8338: name .. 832c gov, 832d eco, 832e tech
ds:8370 commander_name
ds:8379 cargo  # 17 x (held, on offer)
ds:839d market_drawn
ds:8d0a price_table  # 17 x (buy, sell)
ds:905f goods_eco_factor
ds:916f goods_gov_factor
ds:927f goods_base_price
ds:92a1 goods_tech_adj
ds:92e0 market_rng
ds:8bef equipment_records
3362 grf_image_header
33a6 grf_unpack
33d4 grf_read_byte
37e4 set_ega_palette  # 16 attribute registers from ds:si
3821 set_dac  # 768 bytes from ds:si
384f set_video_mode  # E/V/M menu
3921 cycle_flash_colour
ds:10bc video_class  # 0 EGA, 1 VGA16, 2 MCGA
ds:1122 ega_palette
ds:1144 vga_dac
ds:1ee9 colour_map
4154 update_objects
4264 object_in_range
42c8 object_to_camera
43ce draw_ship
44c7 draw_planet_or_sun
3c90 draw_model
3f4d mat_rot_x
3f99 mat_rot_y
3fe5 mat_rot_z
4031 mat_mul
172c fill_triangle
1a7a fill_quad
261b draw_line
6d0a set_player_rot_a
6d83 rotate_pair
6e01 rotate_by_player
6e1c atan2_2048
ds:76de objects
ds:76b5 object_count
ds:2cc0 sin1024
ds:6410 sin2048
ds:28e6 vertex_buffer
ds:10a2 draw_colour
ds:01f8 div_error_resume
4217 position_fits_16bit
4317 rotate_object_to_camera
4359 scanner_blip
46e2 scoop_check
487e compass
433c planet_to_camera
7e82 remove_object
6d26 set_rot_slot
2ab9 draw_circle
2cf4 outline_span
14b0 span_jitter  # main RNG step per span
1507 span_clip
1514 draw_span
4694 apparent_size
9e90 title_screen
9f21 title_frame
301a frame_wait_flip
3130 clear_view
3921 flash_step
0299 screen_key_map
4d8e title_tune
763e init_screen_objects
ds:b1bb title_ship_type
ds:b25f title_hold
ds:b261 title_list_ptr
ds:b263 title_ships
ds:b1bc title_min_dist
ds:b27c ship_names
ds:267c last_flip
ds:45e0 tick_count
702a message_tick
7129 warnings
75d5 fuel_leak
a52f energy_drain
a544 energy_damage
a183 laser_fire
4f4b view_laser
4f34 crosshair
0edf fire_pressed
a0cc tunnel_tick
a63d controls
0f27 steering
10ea arrow_keys
af49 invert_controls
a768 velocity
a7b1 move_objects
6dd9 rotate_back
a027 flight_loop
a040 flight_frame
ds:8058 message
ds:805a message_time
ds:54c8 energy
ds:54c2 laser_temp
ds:af56 speed
ds:af50 velocity
ds:09d1 steer_roll
ds:7410 tan256
