A82: ROM_CALLS


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

A82: ROM_CALLS



The way I understand ROM_CALLS are this: When you do a ROM_CALL, it
calls an address inside Ash which looks up the name of the function you
wanted, and finds out where it is in your specific ROM version. To put a
ROM_call in a program takes up a bit of space, so it is often smaller to
do this

Disp:
ROM_CALL(D_ZT_STR)
ret

than to do 5 rom calls. What if this were in Ash? Most ROM_CALLs are
slow (DISP_GRAPH, FIND_PIXEL) or are only used when speed is hard to get
too slow (Printing a text string), so how about this: At a certain
address inside the Ash code is the following code:

ROM_CALL(D_ZT_STR)
ret

Now, we could do a call $ASH_ADDR+$dztrstroffset and that would make
every ROM CALL a couple bytes smaller. This would impact speed, as it is
another layer of calls.

Another way to do it would be this:

call D_ZT_STR ; D_ZT_STR is an address inside of ash which does the
following:

If ROMVERS = 18 then call $ROM18DZTSTR
If ROMVERS=19 then call $rom18dztsr
ret

Not sure about the advantages of this latter one, as I have not seen the
code in ash taking care of Rom calls. So, Dines, how about implementing
the former idea in your new shell?