Re: A86: Libraries and Loaders


[Prev][Next][Index][Thread]

Re: A86: Libraries and Loaders



Dan Eble wrote:
> 
> On Tue, 5 Aug 1997, B. Nagel wrote:
> 
> > These library/function vars wouldn't need any special formatting or
> > tables, but we better play it safe and use a version # at the beginning:
> >
> > .dw $0000
> > .dw pFixupTable
> 
> Looks okay.
> 
> > I was thinking that the import table could be like:
> >
> > .db $0B,$06,"sprite"
> > .db $0B,$07,"findpix"
> 
> I agree.  Very nice, but how about a byte that tells which function
> within the library to call.  I know you want to have one function per
> library, but let me pose this situation:
> 
>         You have a library, Lsprite (or something) that has a function to
>         do the logical OR of a bitmap to the screen.  If you sometime want
>         to to XOR, it would be convenient if you could just call a second
>         function within that same library, since all the code except for a
>         few lines is the same.
> 
> To simplify things, could we compromise by saying that when a library is
> used, the entire thing is loaded, but also that up to 256 entry points may
> be specified?

Okay, I guess that works.

> > Now about pointers in the table,
> > Why be relative when you can be absolute? :)
> 
> When I wrote up the standard I was thinking of the export tables in the
> libraries and thought it would be easier to have relative pointers there
> (since the vars could be anywhere in memory).  You're 100% correct,
> though.  The programs should definitely use absolute pointers.

cool

> .dw ProgLen      ; number of bytes to load into _asm_exec_ram

I dont think this is necessary, because a shell should be smart enough
to figure this out on its own.


> AsmStart:            ; program run when invoked via Asm( )
>      ; This could print an informative error message,
>      ; actually do something useful, or just return.
>      ret

I was thinking, if a prog used libraries, it could simply replace nop
with ret.

> The title string consists of a length byte, the text bytes, and a null byte.

the length byte isnt necessary, and AShell didnt find it necessary.

Your import table is perfect :)

> .dw LibLen       ; number of bytes to load
> .dw pStartAddr   ; pointer to first address to load (.org 0)

These are needed either, since libraries cant executed.

Bill


Follow-Ups: References: