Skip to content

Commit 14ff592

Browse files
committed
inlined the rcall to enqueue_all_deps
1 parent 3354745 commit 14ff592

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

src/libload/libload.asm

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ macro relocate? name, address*
143143
end macro
144144

145145
relocate helpers, buf + 900
146+
if 0
146147
call_relative:
147148
pop ix
148149
pea ix + 3
@@ -151,6 +152,7 @@ call_relative:
151152
add ix, de
152153
pop de
153154
jp (ix)
155+
end if
154156
jump_relative:
155157
pop ix
156158
push de
@@ -423,7 +425,42 @@ need_to_load_lib:
423425

424426
resolve_entry_points:
425427
ld hl, (ramlocation)
426-
rcall enqueue_all_deps ; get all the dependency pointers that reside in the ram lib
428+
429+
; get all the dependency pointers that reside in the ram lib
430+
enqueue_all_deps: ; we don't need to store anything if we are here
431+
bit keep_in_arc, (iy + LIB_FLAGS)
432+
jr nz, .finish ; really, this is just a precautionary check -- should work fine without
433+
.loop:
434+
res optional, (iy + LIB_FLAGS)
435+
ld a, (hl)
436+
cp a, REQ_LIB_MARKER ; is there a dependency?
437+
jr nz, .check
438+
ex de, hl
439+
ld hl, (end_dep_queue)
440+
ld (hl), de ; save pointer to start of this dependency -- one at a time
441+
inc hl
442+
inc hl
443+
inc hl ; move to next pointer
444+
ld (end_dep_queue), hl ; save next pointer
445+
ex de, hl
446+
.skip:
447+
move_string_to_end
448+
inc hl ; move to start of dependency jump table
449+
ld a, JP_OPCODE
450+
.next:
451+
cp a, (hl) ; jp byte ($C3)
452+
jr nz, .loop
453+
inc hl
454+
inc hl
455+
inc hl
456+
inc hl ; jp address
457+
jr .next
458+
.check:
459+
cp a, ti.AppVarObj
460+
jr z, .skip ; keep going
461+
.finish:
462+
463+
resolve_entry_points_enqueued:
427464
ld hl, (jump_tbl_ptr) ; hl->start of function jump table
428465
ld bc, 3
429466
ld a, JP_OPCODE
@@ -523,39 +560,6 @@ load_next_dep:
523560
ld a, 1
524561
jp (hl) ; passed all the checks; let's start execution! :)
525562

526-
enqueue_all_deps: ; we don't need to store anything if we are here
527-
bit keep_in_arc, (iy + LIB_FLAGS)
528-
ret nz ; really, this is just a precautionary check -- should work fine without
529-
.loop:
530-
res optional, (iy + LIB_FLAGS)
531-
ld a, (hl)
532-
cp a, REQ_LIB_MARKER ; is there a dependency?
533-
jr nz, .check
534-
ex de, hl
535-
ld hl, (end_dep_queue)
536-
ld (hl), de ; save pointer to start of this dependency -- one at a time
537-
inc hl
538-
inc hl
539-
inc hl ; move to next pointer
540-
ld (end_dep_queue), hl ; save next pointer
541-
ex de, hl
542-
.skip:
543-
move_string_to_end
544-
inc hl ; move to start of dependency jump table
545-
ld a, JP_OPCODE
546-
.next:
547-
cp a, (hl) ; jp byte ($C3)
548-
jr nz, .loop
549-
inc hl
550-
inc hl
551-
inc hl
552-
inc hl ; jp address
553-
jr .next
554-
.check:
555-
cp a, ti.AppVarObj
556-
jr z, .skip ; keep going
557-
ret
558-
559563
error_invalid:
560564
rload str_error_invalid
561565
jr throw_error

0 commit comments

Comments
 (0)