summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/lib/libheader.src
blob: 465b96e846eef804f09c5fdd5130dce2c7aaa2d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;-------------------------------------------------------------------------------
; Libload launcher for shared libraries
;-------------------------------------------------------------------------------
	.def	__findlibload

	segment	launcher
	.assume	adl=1

__findlibload:
	call	020628h		; _pushop1 to save running program name
	jr	__tryfind
__inram:
	call	021448h		; _arc_unarc
__tryfind:
	ld	hl,__libloadname-1
	call	020320h		; _mov9toop1
	ld	a,015h		; appvarobj
	ld	(0D005F8h),a	; op1
	call	02050Ch		; _chkfindsym
	jr	c,__notfound
	call	021F98h		; _chkinram
	jr	z,__inram	; if in ram, archive LibLoad and search again
	ld	hl,9+1+__libloadnamelen+2
	add	hl,de
	push	hl
	call	0205C4h		; _popop1 to restore running program name
	pop	hl		; start of loader (required to be in hl)
	ld	de,__relocationstart ; start of relocation data
	jp	(hl)		; jump to the loader -- it should take care of everything else
__notfound:
	call	0205C4h		; _popop1 to restore running program name
	call	020814h		; _clrscrn
	call	020828h		; _homeup
	ld	hl,__missingappvar
	call	0207C0h		; _puts
	call 	0207F0h		; _newline
	ld	hl,__webaddress
	call	0207C0h		; _puts
	jp	020D8Ch		; _getkey

	segment	libs
__relocationstart:		; relocation data will be placed here
	;...
	;...
	;...

	segment	data
__missingappvar:
	db	"Need "
__libloadname:
	db	"LibLoad"
__libloadnamelen := $-__libloadname
	db	0
__webaddress:
	db	"http://tiny.cc/clibs",0