I don't think the QLib runtime module has anything to do with externals. I think the externals are handled by the _OBJ file itself.
I had a very quick look at your assembler code, where you are examining the name table entries with A3 and A5. This is the routine I was thinking about for converting a 'name' into a 'string'
Code: Select all
; ***************************************************************
; UT_GTNM1 Take a supplied string, or name parameter and
; put it on the maths stack as a string. Missing parameters
; cause an empty string to be placed on the maths stack.
; On exit BV_RIP is cleared
; Based on code from SMSQE copyright 1985 Tony Tebby
;
; Entry A1 points to top of Maths stack
; A3 Points to first parameter in name table
; A5 Points to last paramter in name table
; Exit A1 Points to string on Maths stack
; D0 Error return
; D1-D3,A2 Smashed
; ***************************************************************
ut_gtnm1 cmp.l a3,a5 ;is there at least one param?
bgt.s ut_gtnam ;yes, there is
; Return an empty string on the maths stack
ut_gtnul bsr ut_ckri6 ;make room for string on maths stack - 6 bytes
sub.l #2,a1 ;total length of string 2 bytes (length word)
clr.w (a6,a1.l) ;set string length to zero bytes
bra.s utgn_ok ;exit without error
; Get the name type word from the name table entry
ut_gtnam moveq #$f,d0 ;extract type of name
move.w (a6,a3.l),d1 ;get the type word from the name table entry
cmp.w #$0300,d1 ;internal substring array?
beq.s ut_gtnst ;..yes, get it
and.b d1,d0 ;..no, mask out everything but last 4 bits
beq.s ut_gtnul ;return an empty string if a null parameter
tst.w 2(a6,a3.l) ;is there a name?
bmi.s ut_gtnst ;..no, it's $FFFF. Get it as a normal string
subq.b #1,d0 ;is it a string?
bne.s ut_gnmpt ;..no, get it as a name instead
; Get a normal string parameter onto the maths stack
ut_gtnst bsr.s ut_gnst1 ;get one string (no check)
bne.s utgn_rts ;problem? Exit with error
moveq #3,d1 ;round up to word, including char count
add.w (a6,a1.l),d1 ;get length of string on maths stack
bclr #0,d1
add.l d1,bv_rip(a6) ;clear maths stack, but leave A1 pointing at the string
bra.s utgn_ok ;exit without error
; Get a name parameter onto the maths stack
ut_gnmpt moveq #0,d1
move.w 2(a6,a3.l),d1 ;get the pointer to the real entry - in the name table
blt.s ut_gtnul ;... expression is no good - in case a $FFFF slips through
lsl.l #3,d1 ;in multiples of 8 bytes - length of name table entries
add.l bv_ntbas(a6),d1 ;add to base of BASIC name table - to find entry in name table
ut_ntnam moveq #0,d3
move.w 2(a6,d1.l),d3 ;get the entry from name table
add.l bv_nlbas(a6),d3 ;and add to start of name list, to find entry in name list
; Put the name pointed at by D3 onto the maths stack
ut_nmtos moveq #3,d1 ;get the length of the name as a long word
add.b (a6,d3.l),d1 ;get length of entry from name list
bclr #0,d1 ; rounded up (+2)
bsr.s ut_chkri ;make room for D1 bytes on the maths stack
add.l d1,d3 ;move to end of string (ish)
ut_nm_lp subq.l #1,d3 ;adjust pointers
subq.l #1,a1
move.b -1(a6,d3.l),0(a6,a1.l) ;copy bytes of name onto maths stack
subq.w #1,d1 ;decrement loop count
bgt.s ut_nm_lp
clr.b (a6,a1.l) ;clear top byte of string length word
utgn_ok moveq #0,d0
utgn_rts rts
; Reserve D1 bytes on the maths stack
ut_ckri6 movem.l d1/d2/d3/a2,-(a7) ;save registers
moveq #6,d1 ;we want 6 free bytes on the stack
bra.s utc_do
ut_chkri movem.l d1/d2/d3/a2,-(a7) ;save registers
utc_do move.w bv_chrix,a2 ;reserve space
jsr (a2)
movem.l (a7)+,d1/d2/d3/a2 ;and restore them
ut_setri move.l bv_rip(a6),a1
rts
; Get a normal string parameter onto the maths stack
; Returns with D3=no of strings returned, and D0 an error code
ut_gnst1 move.l a5,-(a7) ;save name table top pointer
lea 8(a3),a5 ;set name table to have just one entry
movem.l d4/d6/a0/a2,-(a7) ;save registers
move.w ca_gtstr,a2 ;get a string
jsr (a2) ;do the operation
movem.l (a7)+,d4/d6/a0/a2 ;restore registers
move.l (a7)+,a5 ;restore name table top pointer
rts
I pulled this from my MDI driver source. It allows me to have a SuperBASIC extension that can use a command like - MOUNT_MDI 1,dos1_imagefile_img