mirror of
https://github.com/marketideas/qasm.git
synced 2026-10-25 13:02:45 +00:00
Move the assembler to src/qasm. qlink links OMF 1.0 and 2.0 from a script. makeBin flattens a load file, qomf dumps OMF, and qpro builds ProDOS volumes. APW and MPW assemble through the ORCA front end. Relocatable modules emit OMF objects. Listings stay off unless -l is set. make boot assembles the GS/OS 6.0.1 ProDOS 8 kernel and BASIC.SYSTEM into an 800K volume. BASIC.SYSTEM accepts ls and pfx, and its splash reports PRODOS BASIC 2.0, copyright 1983-2026. IIGS.601.SRC is the source and the BASIC.SYSTEM oracle that image is built from.
1 line
9.1 KiB
Plaintext
1 line
9.1 KiB
Plaintext
TITLE ', System Loader v4.00'
|
|
print nogen,nomdir
|
|
pagesize 70
|
|
CASE ON
|
|
*
|
|
****************************************************************
|
|
*
|
|
* System Loader
|
|
* by
|
|
* Lou Infeld
|
|
*
|
|
* Version 4.0
|
|
* by
|
|
* Greg Branche
|
|
*
|
|
* Copyright Apple Computer, Inc. 1986-1992
|
|
* All Rights Reserved
|
|
*
|
|
****************************************************************
|
|
*
|
|
; Routine Index file page
|
|
;
|
|
; LoaderEquates LOADER.EQUATES 3
|
|
; LoaderDispatcher LOADER.a 8
|
|
; Loader function setup 10
|
|
;
|
|
; Loader Functions
|
|
;
|
|
ENTRY LoaderInit ; FUNCTIONS.a 18
|
|
ENTRY LoaderVersion ; FUNCTIONS.a 19
|
|
ENTRY LoaderReset ; FUNCTIONS.a 19
|
|
ENTRY LoaderStartup ; FUNCTIONS.a 19
|
|
ENTRY LoaderShutdown ; FUNCTIONS.a 19
|
|
ENTRY Load_NI ; FUNCTIONS.a 20
|
|
ENTRY LoaderStatus ; FUNCTIONS.a 19
|
|
ENTRY LoadNum ; FUNCTIONS.a 21
|
|
ENTRY ULoadNum ; FUNCTIONS.a 23
|
|
ENTRY LoadName ; FUNCTIONS.a 25
|
|
ENTRY ULoadSeg ; FUNCTIONS.a 31
|
|
ENTRY GetInfo ; FUNCTIONS.a 35
|
|
ENTRY GetUserID ; FUNCTIONS.a 39
|
|
ENTRY GetUserID2 ; FUNCTIONS.a 40
|
|
ENTRY GetPathname ; FUNCTIONS.a 41
|
|
ENTRY GetPathname2 ; FUNCTIONS.a 43
|
|
ENTRY UserShutdown ; FUNCTIONS.a 48
|
|
ENTRY RenamePathname ; FUNCTIONS.a 50
|
|
ENTRY GetGlobalsAddr ; FUNCTIONS.a 53
|
|
ENTRY InitLoad ; INIT.LOAD.a 63
|
|
ENTRY InitLoad2 ; INIT.LOAD.a 64
|
|
ENTRY InitInit ; INIT.LOAD.a 65
|
|
ENTRY Restart ; RESTART.a 66
|
|
ENTRY JumpLoad ; JUMP.a 75
|
|
ENTRY Switch_handler ; ExpressLoad.a 81
|
|
; Entry startup ; ExpressLoad.a 83
|
|
Entry get_parameters ; ExpressLoad.a 85
|
|
Entry return_to_caller ; ExpressLoad.a 87
|
|
;
|
|
; ExpressLoad stuff
|
|
;
|
|
; Entry lock_handles ; ExpressLoad.a 89
|
|
; Entry clear_handles ; ExpressLoad.a 92
|
|
; Entry alloc_ExpLoad ; ExpressLoad.a 94
|
|
; Entry alloc_mem ; ExpressLoad.a 94+
|
|
; Entry alloc_my_dp ; ExpressLoad.a 96
|
|
; Entry alloc_LConst_seg ; ExpressLoad.a 97
|
|
; Entry add_id_table ; ExpressLoad.a 99
|
|
; Entry reset_local_mark ; ExpressLoad.a 101
|
|
; Entry seg_num_lookup ; ExpressLoad.a 102
|
|
; Entry my_seg_to_user_seg ; ExpressLoad.a 103
|
|
; Entry error_routine ; ExpressLoad.a 105
|
|
; Entry make_HET_ptr ; ExpressLoad.a 106
|
|
; Entry setup_seg_ptrs ; ExpressLoad.a 107
|
|
; Entry setup_base_ptr ; ExpressLoad.a 108
|
|
; Entry alloc_id ; ExpressLoad.a 109
|
|
; Entry compare_paths ; ExpressLoad.a 110
|
|
; Entry merge_path ; ExpressLoad.a 112
|
|
; Entry add_user_id ; ExpressLoad.a 113
|
|
; Entry delete_user_id ; ExpressLoad.a 115
|
|
; Entry purge_user_id ; ExpressLoad.a 117
|
|
; Entry remove_segment ; ExpressLoad.a 118
|
|
; Entry find_user_id ; ExpressLoad.a 120
|
|
; Entry path_to_user_id ; ExpressLoad.a 122
|
|
; Entry find_seg_handle ; ExpressLoad.a 124
|
|
; Entry get_seg_base ; ExpressLoad.a 126
|
|
; Entry Process_Reloc ; ExpressLoad.a 128
|
|
; Entry Reloc_handler ; ExpressLoad.a 131
|
|
; Entry cReloc_handler ; ExpressLoad.a 132
|
|
; Entry Interseg_handler ; ExpressLoad.a 133
|
|
; Entry cInterseg_handler ; ExpressLoad.a 135
|
|
; Entry super_handler ; ExpressLoad.a 136
|
|
; Entry Interseg_1 ; ExpressLoad.a 138
|
|
; Entry Interseg_14 ; ExpressLoad.a 140
|
|
; Entry Interseg_26 ; ExpressLoad.a 142
|
|
; Entry reloc2 ; ExpressLoad.a 144
|
|
; Entry reloc3 ; ExpressLoad.a 145
|
|
; Entry shift_patch ; ExpressLoad.a 147
|
|
; Entry read_less_64k ; ExpressLoad.a 149
|
|
; Entry set_mark ; ExpressLoad.a 150
|
|
; Entry check_express_seg ; ExpressLoad.a 151
|
|
; Entry find_Segment ; ExpressLoad.a 153
|
|
; Entry chk_dynamic_seg ; ExpressLoad.a 155
|
|
; Entry save_ref_num ; ExpressLoad.a 156
|
|
; Entry get_express_seg ; ExpressLoad.a 157
|
|
; Entry store_pathname ; ExpressLoad.a 159
|
|
; Entry close_dynamic_file ; ExpressLoad.a 161
|
|
; Entry close_load_file ; ExpressLoad.a 163
|
|
; Entry open_load_file ; ExpressLoad.a 165
|
|
; Entry conv_attributes ; ExpressLoad.a 169
|
|
; Entry reset_jmp_tables ; ExpressLoad.a 171
|
|
; Entry make_purgable ; ExpressLoad.a 173
|
|
; Entry purge_all_dyn ; ExpressLoad.a 175
|
|
; Entry mark_all_purgable ; ExpressLoad.a 176
|
|
; Entry lock_statics ; ExpressLoad.a 178
|
|
; Entry lock_segment ; ExpressLoad.a 180
|
|
; Entry load_segment ; ExpressLoad.a 182
|
|
; Entry find_Seg_name ; ExpressLoad.a 187
|
|
; Entry save_dp_info ; ExpressLoad.a 189
|
|
; Entry load_statics ; ExpressLoad.a 190
|
|
; Entry save_start ; ExpressLoad.a 192
|
|
; Entry reload_restart ; ExpressLoad.a 193
|
|
; Entry reload_inits ; ExpressLoad.a 195
|
|
; Entry zero_handles ; ExpressLoad.a 197
|
|
; Entry rename_segments ; ExpressLoad.a 198
|
|
;
|
|
; Processing segments
|
|
;
|
|
ENTRY Load_Segment ; SEGMENTS.a 202
|
|
ENTRY Find_Segment ; SEGMENTS.a 204
|
|
ENTRY Do_Segment ; SEGMENTS.a 208
|
|
ENTRY Do_Init_Segment ; SEGMENTS.a 212
|
|
ENTRY Do_Path_Segment ; SEGMENTS.a 213
|
|
ENTRY Do_Jump_Segment ; SEGMENTS.a 215
|
|
ENTRY Allocate_Segment ; SEGMENTS.a 217
|
|
ENTRY Purge_Segment ; SEGMENTS.a 219
|
|
ENTRY Zero_Segment ; SEGMENTS.a 222
|
|
ENTRY Check_KIND ; SEGMENTS.a 223
|
|
;
|
|
; Relocation routines
|
|
;
|
|
ENTRY Do_LCONST ; RELOCATION.a 224
|
|
ENTRY Do_DS ; RELOCATION.a 226
|
|
ENTRY Do_RELOC ; RELOCATION.a 227
|
|
ENTRY Do_cRELOC ; RELOCATION.a 228
|
|
ENTRY Do_INTERSEG ; RELOCATION.a 229
|
|
ENTRY Do_cINTERSEG ; RELOCATION.a 230
|
|
ENTRY Do_SUPER ; RELOCATION.a 232
|
|
ENTRY Common_Pass1_Check ; RELOCATION.a 236
|
|
ENTRY Common_INTERSEG ; RELOCATION.a 237
|
|
ENTRY Common_Reloc ; RELOCATION.a 238
|
|
;
|
|
; Processing file routines
|
|
;
|
|
ENTRY Next_Header ; FILES.a 240
|
|
ENTRY Read_File ; FILES.a 242
|
|
ENTRY Actual_Read ; FILES.a 244
|
|
ENTRY Read_Op ; FILES.a 246
|
|
ENTRY Read_Record ; FILES.a 247
|
|
ENTRY Skip_Header ; FILES.a 248
|
|
ENTRY Next_Dictionary ; FILES.a 249
|
|
ENTRY Open_File ; FILES.a 253
|
|
ENTRY Close_File ; FILES.a 256
|
|
ENTRY Fill_File_Buff ; FILES.a 257
|
|
ENTRY Save_Mark ; FILES.a 258
|
|
ENTRY Bump_Mark ; FILES.a 261
|
|
;
|
|
; Data structure handling
|
|
;
|
|
ENTRY Add_Link ; STRUCT.a 262
|
|
ENTRY Remove_Link ; STRUCT.a 264
|
|
ENTRY Add_Pathname ; STRUCT.a 266
|
|
ENTRY Find_Pathname ; STRUCT.a 269
|
|
ENTRY Next_Pathname ; STRUCT.a 269+
|
|
ENTRY Get_Pathname ; STRUCT.a 272
|
|
ENTRY Convert_Pathname ; STRUCT.a 274
|
|
ENTRY Expand_Pathname ; STRUCT.a 276
|
|
ENTRY Add_MemSeg ; STRUCT.a 278
|
|
ENTRY Find_MemSeg ; STRUCT.a 280
|
|
ENTRY Next_MemSeg ; STRUCT.a 280+
|
|
ENTRY Remove_UserID ; STRUCT.a 282
|
|
ENTRY Unload_JTL ; STRUCT.a 284
|
|
ENTRY Cleanup ; STRUCT.a 286
|
|
;
|
|
; Miscellaneous routines
|
|
;
|
|
ENTRY Get_TempBuff ; MISC.a 287
|
|
ENTRY Block_Move ; MISC.a 288
|
|
ENTRY DeRefUse ; MISC.a 292
|
|
ENTRY UsePtr ; MISC.a 293
|
|
ENTRY DeRef ; MISC.a 294
|
|
; Entry save_dp ; MISC.a 295
|
|
; Entry restore_dp ; MISC.a 296
|
|
;
|
|
|
|
PRINT PUSH
|
|
PRINT OFF
|
|
INCLUDE 'Loader.Macros'
|
|
INCLUDE 'M16.Memory'
|
|
INCLUDE 'E16.Memory'
|
|
INCLUDE 'M16.MiscTool'
|
|
INCLUDE 'E16.GSOS'
|
|
PRINT POP
|
|
|
|
INCLUDE 'Loader.Preamble'
|
|
INCLUDE 'Loader.Equates'
|
|
|
|
DataChk Off
|
|
|
|
TITLE ', LOADER.A - LoaderDispatcher'
|
|
SEG 'Loader'
|
|
*
|
|
****************************************************************
|
|
*
|
|
* System Loader Function Table
|
|
*
|
|
****************************************************************
|
|
*
|
|
CallTable Proc
|
|
DC.L (tableEnd-CallTable)/4 ; # of loader functions
|
|
DC.L LoaderInit-1 ;$01
|
|
DC.L LoaderStartup-1 ;$02
|
|
DC.L LoaderShutdown-1 ;$03
|
|
DC.L LoaderVersion-1 ;$04
|
|
DC.L LoaderReset-1 ;$05
|
|
DC.L LoaderStatus-1 ;$06
|
|
DC.L Load_NI-1 ;$07
|
|
DC.L Load_NI-1 ;$08
|
|
DC.L InitLoad-1 ;$09
|
|
DC.L Restart-1 ;$0A
|
|
DC.L LoadNum-1 ;$0B
|
|
DC.L ULoadNum-1 ;$0C
|
|
DC.L LoadName-1 ;$0D
|
|
DC.L ULoadSeg-1 ;$0E
|
|
DC.L GetInfo-1 ;$0F
|
|
DC.L GetUserID-1 ;$10
|
|
DC.L GetPathname-1 ;$11
|
|
DC.L UserShutdown-1 ;$12
|
|
DC.L RenamePathname-1 ;$13
|
|
DC.L Load_NI-1 ;$14
|
|
DC.L Load_NI-1 ;$15
|
|
DC.L Load_NI-1 ;$16
|
|
DC.L Load_NI-1 ;$17
|
|
DC.L Load_NI-1 ;$18
|
|
DC.L Load_NI-1 ;$19
|
|
DC.L Load_NI-1 ;$1A
|
|
DC.L Load_NI-1 ;$1B
|
|
DC.L Load_NI-1 ;$1C
|
|
DC.L Load_NI-1 ;$1D
|
|
DC.L GetGlobalsAddr-1 ;$1E
|
|
DC.L Switch_handler-1 ;$1F
|
|
DC.L InitLoad2-1 ;$20
|
|
DC.L GetUserID2-1 ;$21
|
|
DC.L GetPathname2-1 ;$22
|
|
tableEnd equ *
|
|
EndP
|
|
|
|
Include 'Data.a'
|
|
|
|
TITLE ', System Loader Function setup'
|
|
SEG 'Loader'
|
|
*
|
|
****************************************************************
|
|
*
|
|
* Stack is assumed to look like this before a Loader function
|
|
* is called:
|
|
*
|
|
* Contents Length
|
|
* -------- ------
|
|
* output parameter ?
|
|
* input parameters param_bytes
|
|
* return address to calling routine 3
|
|
* return address to Tool Dispatcher 3
|
|
* top of stack
|
|
*
|
|
****************************************************************
|
|
|
|
INCLUDE 'Functions.a'
|
|
INCLUDE 'Init.Load.a'
|
|
INCLUDE 'Restart.a'
|
|
INCLUDE 'Jump.a'
|
|
Include 'ExpressLoad.a'
|
|
INCLUDE 'Segments.a'
|
|
INCLUDE 'Relocation.a'
|
|
INCLUDE 'Files.a'
|
|
INCLUDE 'Struct.a'
|
|
INCLUDE 'Misc.a'
|
|
|
|
END
|