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
13 KiB
Plaintext
1 line
13 KiB
Plaintext
TITLE ', LOADER.EQUATES'
|
|
*
|
|
****************************************************************
|
|
*
|
|
* System Loader Equates
|
|
*
|
|
****************************************************************
|
|
*
|
|
;
|
|
; Loader Errors
|
|
;
|
|
NoFind EQU $1101 ;Segment not found
|
|
seg_not_found equ $1101
|
|
BadOMF EQU $1102 ;Object Module Format Version error
|
|
BadPath EQU $1103 ;Pathname error
|
|
NotLoad EQU $1104 ;File not a Load File
|
|
not_load_file equ $1104
|
|
BadVers EQU $1107 ;File Version error
|
|
BadUser EQU $1108 ;UserID error
|
|
BadNum EQU $1109 ;SegNum out of sequence
|
|
Illegal EQU $110A ;Illegal load record found
|
|
illegal_record equ $110A
|
|
Foreign EQU $110B ;Segment is foreign
|
|
User_id_err equ $11F0 ;I could not find a user_id when I should have
|
|
incompatible_err equ $11F1 ;The file is not expressload compatible
|
|
ExpressSegLost equ $11F2 ;The ExpressSeg Handle is lost
|
|
|
|
;
|
|
; KIND values
|
|
;
|
|
Code_Segment EQU $00
|
|
Data_Segment EQU $01
|
|
Jump_Segment EQU $02
|
|
Path_Segment EQU $04
|
|
Lib_Segment EQU $08
|
|
Init_Segment EQU $10
|
|
Direct_Segment EQU $12
|
|
BankRel_Segment EQU %0000000100000000
|
|
Skip_Segment EQU %0000001000000000
|
|
Reload_Segment EQU %0000010000000000
|
|
AbsBank_Segment EQU %0000100000000000
|
|
NoSpec_Segment EQU %0001000000000000
|
|
PosInd_Segment EQU %0010000000000000
|
|
Priv_Segment EQU %0100000000000000
|
|
Dyn_Segment EQU %1000000000000000
|
|
;
|
|
; Load Segment legal record codes
|
|
;
|
|
END EQU $00 ;END record
|
|
RELOC EQU $E2 ;Relocation record
|
|
INTERSEG EQU $E3 ;Inter-Segment relocation record
|
|
DS EQU $F1 ;Zero Fill record
|
|
LCONST EQU $F2 ;Long Constant record
|
|
cRELOC EQU $F5 ;compressed RELOC record
|
|
cINTERSEG EQU $F6 ;compressed INTERSEG record
|
|
SUPER EQU $F7 ;super compressed record
|
|
;
|
|
; Memory Segment Table entry offsets
|
|
;
|
|
MS_Next EQU 0 ;Handle to Next Entry
|
|
MS_Prev EQU MS_Next+4 ;Handle to Previous Entry
|
|
MS_UserID EQU MS_Prev+4 ;UserID of this entry
|
|
MS_Handle EQU MS_UserID+2 ;Handle to Memory Segment
|
|
MS_FileNum EQU MS_Handle+4 ;File Number
|
|
MS_SegNum EQU MS_FileNum+2 ;Segment Number
|
|
MS_Kind EQU MS_SegNum+2 ;Segment Kind
|
|
;
|
|
; Pathname Table entry offsets
|
|
;
|
|
PT_Next EQU 0 ;Handle to Next Entry
|
|
PT_Prev EQU PT_Next+4 ;Handle to Previous Entry
|
|
PT_UserID EQU PT_Prev+4 ;UserID
|
|
PT_FileNum EQU PT_UserID+2 ;File Number
|
|
PT_Date EQU PT_FileNum+2 ;File Date
|
|
PT_ZP_Addr EQU PT_Date+8 ;Zero Page/Stack Address
|
|
PT_ZP_Size EQU PT_ZP_Addr+2 ;Zero Page/Stack Size
|
|
PT_Jump EQU PT_ZP_Size+2 ;Jump Table Segment processed flag
|
|
PT_Address EQU PT_Jump+2 ;Starting Address
|
|
PT_Path EQU PT_Address+4 ;File Pathname
|
|
;
|
|
; Jump Table List entry offsets
|
|
;
|
|
JT_Next EQU 0 ;Handle to Next Entry
|
|
JT_Prev EQU JT_Next+4 ;Handle to Previous Entry
|
|
JT_UserID EQU JT_Prev+4 ;UserID
|
|
JT_Handle EQU JT_UserID+2 ;Handle to Jump Table Segment
|
|
;
|
|
; Jump Table Entry offsets
|
|
;
|
|
JE_UserID EQU 0 ;UserID
|
|
JE_FileNum EQU JE_UserID+2 ;Load File Number
|
|
JE_SegNum EQU JE_FileNum+2 ;Load Segment Number
|
|
JE_Offset EQU JE_SegNum+2 ;Load Segment Offset
|
|
JE_jsl EQU JE_Offset+4 ;call to System Loader
|
|
;
|
|
; Mark List offsets
|
|
;
|
|
ML_NextAvail EQU 0 ;Next Available Slot
|
|
ML_EndList EQU 4 ;End of List
|
|
ML_FirstEntry EQU 8 ;first entry
|
|
ML_SizeEntry EQU 6 ;size of each entry
|
|
ML_SegNum EQU 0 ;Segment Number in entry
|
|
ML_Mark EQU 2 ;File Mark in entry
|
|
;
|
|
; UserID's
|
|
;
|
|
uLoader EQU $7001 ;Main ID for the Loader
|
|
uExpressSegment equ $7101 ;ID to use for ExpressLoad segment
|
|
uUserIDTable equ $7201 ;ID to use for User ID tables
|
|
uTempDP equ $7E01 ;ID to use for temporary direct page storage
|
|
uDirectPage equ $7F01 ;ID to use for the direct page
|
|
uLoader_Caller EQU $7002 ;Loader Caller
|
|
uSEGTBL EQU $7003 ;Memory Segment Table
|
|
uPATHTBL EQU $7004 ;Pathname Table
|
|
uJMPTBL EQU $7005 ;Jump Table List
|
|
uFileBuff EQU $7006 ;File Buffer
|
|
uMarkList EQU $7007 ;Mark List
|
|
uTempBuff EQU $7008 ;Temporary Buffer
|
|
uLGetPathname equ $7708 ;ID to use for LGetPathname2 return string
|
|
uResource EQU $7009 ;internal UserID for Resources
|
|
uGQuit EQU $3200 ;GQuit UserID (assigns aux memory for Loader)
|
|
|
|
*
|
|
****************************************************************
|
|
*
|
|
* Miscellaneous Equates
|
|
*
|
|
****************************************************************
|
|
*
|
|
;...............................................................
|
|
;
|
|
; GS/OS equates
|
|
;...............................................................
|
|
CVT_0TO1 EQU $01FC74 ;Convert 0 string to 1
|
|
CVT_1TO0 EQU $01FC78 ;Convert 1 string to 0
|
|
|
|
;...............................................................
|
|
;
|
|
; File types
|
|
;...............................................................
|
|
Load_File EQU $B3
|
|
Last_Load_File EQU $BE
|
|
CDev_File EQU $C7
|
|
app_type equ $00B3
|
|
|
|
|
|
;...............................................................
|
|
;
|
|
; UserID Types
|
|
;...............................................................
|
|
Application EQU $1000
|
|
|
|
;...............................................................
|
|
;
|
|
; Memory Manager Allocation Attributes (not used by Memory
|
|
; Manager but simulated by System Loader)
|
|
;...............................................................
|
|
Any_Bank EQU %0000000001000000
|
|
|
|
;...............................................................
|
|
;
|
|
; GS/OS functions
|
|
;...............................................................
|
|
; class 0 calls
|
|
SET_FILE_INFO EQU $05
|
|
GET_FILE_INFO EQU $06
|
|
SET_PREFIX EQU $09
|
|
GET_PREFIX EQU $0A
|
|
PD_READ EQU $12
|
|
PD_WRITE EQU $13
|
|
PD_CLOSE EQU $14
|
|
SET_MARK EQU $16
|
|
GET_MARK EQU $17
|
|
SET_EOF EQU $18
|
|
GET_EOF EQU $19
|
|
GET_BOOT_VOL EQU $28
|
|
QUIT EQU $29
|
|
GET_VERSION EQU $2A
|
|
|
|
; class 1 calls
|
|
SetSysPrefs EQU $200C
|
|
ExpandPath EQU $200E
|
|
GetSysPrefs EQU $200F
|
|
Open EQU $2010
|
|
SetLevel EQU $201A
|
|
GetLevel EQU $201B
|
|
GetRefNum EQU $2038
|
|
GetFileInfo EQU $2006
|
|
|
|
;====================================================================================================
|
|
;offset in the segment header
|
|
;====================================================================================================
|
|
|
|
; These values define the bit positions within the HET_Entry SegFlags word.
|
|
; Bit 15 : 1 = segment is currently in memory
|
|
; 14-3 : currently unused
|
|
; 2 : 1 = segment is static
|
|
; 1 : 1 = segment is jump table
|
|
; 0 : 1 = purgeable
|
|
;
|
|
jmp_type equ $0002 ;indicates a jump table segment
|
|
stat_type equ $0004 ;indicates a static segment
|
|
|
|
;====================================================================================================
|
|
;Memory Manager equates
|
|
;====================================================================================================
|
|
|
|
attr_locked equ $8000 ;memory segment is locked
|
|
attr_fixed equ $4000 ;block can't move in memory
|
|
purge_level_3 equ $0300 ;set purge level to three for dynamics only
|
|
attr_align_in_bank equ $0040 ;Align to address within the bank
|
|
attr_bank_align equ $0020 ;force bank alignment
|
|
attr_no_cross equ $0010 ;cannot cross any bank
|
|
attr_no_spec equ $0008 ;no special memory
|
|
attr_page equ $0004 ;page aligned segment
|
|
attr_addr equ $0002 ;block must remain at fixed addr
|
|
attr_bank equ $0001 ;fixed bank address
|
|
|
|
;====================================================================================================
|
|
;equates used by function calls
|
|
;====================================================================================================
|
|
|
|
max_input equ 10 ; maximum # of input parm bytes
|
|
|
|
func_9_param_cnt equ 8 ; 8 bytes of input
|
|
func_0A_param_cnt equ 2 ; 2 bytes of input
|
|
func_0B_param_cnt equ 6 ; 6 bytes of input
|
|
func_0C_param_cnt equ 6 ; 6 bytes of input
|
|
func_0D_param_cnt equ 10 ;10 bytes of input
|
|
func_0E_param_cnt equ 4 ; 4 bytes of input
|
|
func_0F_param_cnt equ 10 ;10 bytes of input
|
|
func_10_param_cnt equ 4 ; 4 bytes of input
|
|
func_11_param_cnt equ 4 ; 4 bytes of input
|
|
func_12_param_cnt equ 4 ; 4 bytes of input
|
|
func_13_param_cnt equ 8 ; 8 bytes of input
|
|
func_15_param_cnt equ 2 ; 2 bytes of input
|
|
func_20_param_cnt equ 10 ;10 bytes of input
|
|
func_21_param_cnt equ 4 ; 4 bytes of input
|
|
func_22_param_cnt equ 4 ; 4 bytes of input
|
|
|
|
;====================================================================================================
|
|
;General equates
|
|
;====================================================================================================
|
|
jmp_tbl_seg equ $02
|
|
seg_jmp_start equ 08
|
|
jmp_entry_size equ 14
|
|
|
|
my_level equ $70 ;use to set the system level
|
|
keep_id equ $0001 ;Tell Delete_User_ID to keep the ID around after deleting memory
|
|
nuke_id equ $0000 ;delete memory and the user_id
|
|
|
|
absolute equ $0000
|
|
forward equ $0001
|
|
backward equ $0002
|
|
|
|
Data_Kind equ $0001 ;and it is a data segment
|
|
dynamic equ $8000 ;It is also Dynamic
|
|
kind_only equ $001F ;clear all but the segment kind
|
|
init_seg_type equ $10
|
|
dp_seg_type equ $12
|
|
static_code_type equ $0000
|
|
static_and_kind equ $801F
|
|
static_type equ $00
|
|
static_only equ $8000
|
|
all_types equ 00
|
|
any_kind equ 00
|
|
any_state equ 00
|
|
unloaded_state equ $8000
|
|
kind_bank_bit equ $0100 ;bank bit
|
|
kind_abs_bank equ $0800
|
|
|
|
|
|
locked_no_cross equ $8010
|
|
locked_only equ $8000
|
|
|
|
seperator equ $3A ;seperator is a colon
|
|
|
|
purge_all equ $0000 ;and mask used to compare flags
|
|
purge_dynamics equ $0004 ;Bit 2 = static bit. If 1 then static
|
|
|
|
statereg equ $E0C068
|
|
incbusyflg equ $E10064
|
|
decbusyflg equ $E10068
|
|
|
|
;====================================================================================================
|
|
;Equates used for the User_ID_table
|
|
;====================================================================================================
|
|
id_tbl_size equ 2048 ;a 2K table. Value must be an even positive number!
|
|
id_entry_size equ 16
|
|
id_entry_cnt equ 126 ;number of entries in one table
|
|
|
|
TITLE ', Data Template Definitions'
|
|
;====================================================================================================
|
|
; data template definitions
|
|
;====================================================================================================
|
|
|
|
ID_Table_Entry Record 0
|
|
UserID ds.w 1 ;the user id
|
|
ExpressHandle ds.l 1 ;handle to ExpressLoad segment
|
|
Stack_Addr ds.w 1 ;address of stack segment
|
|
Stack_Size ds.w 1 ;size of stack segment
|
|
Start_Addr ds.l 1 ;starting address of application
|
|
filler ds.b id_entry_size-* ;fill out to paragraph boundary
|
|
EndR
|
|
|
|
User_ID_Table Record 0
|
|
Next ds.l 1 ;handle of next table in linked list
|
|
filler ds.b 16-(*-User_ID_Table) ;fill out to paragraph boundary
|
|
Table_Entry ds ID_Table_Entry ;ID_Table_Entry[id_entry_cnt]
|
|
ds.b id_tbl_size-*
|
|
EndR
|
|
|
|
SegHeaderEntry Record 0
|
|
LConst_Mark ds.l 1
|
|
LConst_Length ds.l 1
|
|
RelocDict_Mark ds.l 1
|
|
RelocDict_Length ds.l 1
|
|
ds.b 1 ;reserved
|
|
LabLen ds.b 1
|
|
NumLen ds.b 1
|
|
Version ds.b 1
|
|
BankSize ds.l 1
|
|
Kind ds.w 1
|
|
ds.w 1 ;reserved
|
|
Org ds.l 1
|
|
Align ds.l 1
|
|
NumSex ds.b 1
|
|
ds.b 1 ;reserved
|
|
SegNum ds.w 1
|
|
Entry ds.l 1
|
|
DispName ds.w 1
|
|
RelocDict_Hndl ds.l 1
|
|
ds.b 8 ;reserved
|
|
name_overhead equ *-DispName
|
|
EndR
|
|
|
|
HET_Entry Record 0
|
|
SegOffset ds.w 1 ;relative offset to first header entry
|
|
SegFlags ds.w 1 ;segment flags
|
|
SegHandle ds.l 1 ;segment handle
|
|
EndR
|
|
|
|
ExpressloadSeg Record 0
|
|
RefNum ds.w 1 ;reserved field in ExpressSeg LConst
|
|
PathnameOffset ds.w 1 ;offset of pathname within segment
|
|
SegCount ds.w 1 ;number of segments in ExpressSeg
|
|
SegEntry ds HET_Entry ;array of HET_Entry
|
|
SegConversion ds.w 1 ;array of integer (seg number conversion)
|
|
SegHeader ds SegHeaderEntry ;array of SegHeaderEntry
|
|
EndR
|
|
|
|
SegmentHeader Record 0
|
|
ByteCnt ds.l 1
|
|
ResSpc ds.l 1
|
|
Length ds.l 1
|
|
oldKind ds.b 1
|
|
LabLen ds.b 1
|
|
NumLen ds.b 1
|
|
Version ds.b 1
|
|
BankSize ds.l 1
|
|
Kind ds.w 1
|
|
ds.w 1 ;undefined
|
|
Org ds.l 1
|
|
Align ds.l 1
|
|
NumSex ds.b 1
|
|
LCBank ds.b 1
|
|
SegNum ds.w 1
|
|
Entry ds.l 1
|
|
DispName ds.w 1
|
|
DispData ds.w 1
|
|
toDispData
|
|
LoadName ds.b 10
|
|
SegName ds.b 13 ;enough room for ~ExpressLoad
|
|
LConst ds.b 5 ;LConst record header
|
|
SegHeaderSize
|
|
EndR
|
|
|
|
openParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
refNum ds.w 1
|
|
pathname ds.l 1
|
|
requestAccess ds.w 1
|
|
resourceNumber ds.w 1
|
|
access ds.w 1
|
|
fileType ds.w 1
|
|
auxType ds.l 1
|
|
storageType ds.w 1
|
|
createDateTime ds.b 8
|
|
modDateTime ds.b 8
|
|
endr
|
|
|
|
readParms Record 0 ;class 0 parm block
|
|
fileRefNum ds.w 1
|
|
dataBuffer ds.l 1
|
|
requestCount ds.l 1
|
|
transferCount ds.l 1
|
|
EndR
|
|
|
|
markParms Record 0 ;class 0 parm block
|
|
markRefNum ds.w 1
|
|
position ds.l 1
|
|
EndR
|
|
|
|
expandParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
inputPath ds.l 1
|
|
outputPath ds.l 1
|
|
flags ds.w 1
|
|
EndR
|
|
|
|
sysPrefsParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
preferences ds.w 1
|
|
EndR
|
|
|
|
levelParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
level ds.w 1
|
|
levelMode ds.w 1
|
|
EndR
|
|
|
|
getRefNumParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
pathname ds.l 1
|
|
refNum ds.w 1
|
|
EndR
|
|
|
|
getFileInfoParms Record 0 ;class 1 parm block
|
|
pCount ds.w 1
|
|
pathname ds.l 1
|
|
access ds.w 1
|
|
fileType ds.w 1
|
|
auxType ds.l 1
|
|
storageType ds.w 1
|
|
createDateTime ds.b 8
|
|
modDateTime ds.b 8
|
|
EndR |