DC_Elf, Executable and Linkable Format (ELF) Interface

Register parameters

RST 20H, DEFB $260C

RST 20H, DEFW $260C
 IN:
     A = reason code
		EL_Op ($00), open ELF file
		EL_Hi ($02), get ELF header information
		EL_Pi ($04), get program header information for memory allocation
		EL_Ld ($06), load ELF segment to memory
		EL_Ex ($08), execute ELF
		EL_Cl ($0A), close ELF file
     IX = handle
     Other register parameters depend on reason code
OUT:
     Depends on reason code, see below.

Notes

Internal operating system usage.
This call implements the ELF low level interface with OZ. Refer to GN_Elf for user level interfacing.

EL_Op

EL_Op (A=$00), open ELF file
 IN: 	A  = 0
	 	IX = file handle

OUT: Fc = 0, successful
		IX = ELF handle
		A  = ELF type
		BC = number of program header
		DE = number of section header
		HL = information header buffer address

	 Fc = 1, failure and A = error

Registers changed after return:
     ......../..IY same
     AFBCDEHL/IX.. different

EL_Hi

EL_Hi (A=$02), get ELF header information
 IN:
     	A = 2
     	IX = ELF handle

OUT: Fc = 0, successful
		A  = ELF type
		BC = number of program header
		DE = number of section header
		HL = information header buffer address

	 Fc = 1, failure and A = error

Registers changed after return:
     ......../IXIY same
     AFBCDEHL/.... different

EL_Pi

EL_Pi (A=$04), get program header information for memory allocation
 IN:
     A = 4
	 C = program header index (ELF segment)
     IX = ELF handle

OUT: Fc = 0, successful
		A = program type
		BC = program address requested
		DE = memory size requested
		HL = program header information buffer address

	 Fc = 1, failure and A = error

Registers changed after return:
     ......../IXIY same
     AFBCDEHL/.... different 

EL_Ld

EL_Ld (A=$06), load ELF segment to memory
 IN:
     A = 6
	 C = program header index (ELF segment)
     IX = ELF handle

OUT: Fc = 0, successful
		A = bank allocated
		BC = address allocated
		DE = memory size allocated
		HL = program header information buffer address

	 Fc = 1, failure and A = error

Registers changed after return:
     ......../IXIY same
     AFBCDEHL/.... different

EL_Ex

EL_Ld (A=$08), execute ELF
 IN:
     A = 8
     IX = ELF handle

OUT: 
	 -


Return from execution is performed by DC_Rte.

EL_Cl

EL_Ld (A=$0A), close ELF file
 IN:
     A = $0A
	 IX = ELF handle

OUT: Fc = 0, successful
	 Fc = 1, failure and A = error

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different

Related calls

DC_Rte, Return from ELF
GN_Elf, Enter ELF program

web analytics