29.12.2012 Views

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.12 SYSTEM OVERLAY ACCESS<br />

Practically all of the functions contained in the system overlays are accessed via<br />

library commands or standard SuperVisor Calls. Only in a few unique cases is access <strong>to</strong><br />

overlay functions through the SYSTEM SVC required. <strong>The</strong> two cases, calculating the file<br />

specification hash code and the password string hash code, have been discussed. <strong>The</strong><br />

system functions provided in the overlays will usually have a standard SuperVisor Call<br />

assigned. <strong>The</strong>se SVCs have been discussed in chapter 7. <strong>The</strong> system translates standard SVC<br />

numbers within SYSRES <strong>to</strong> the overlay entry number in order <strong>to</strong> process the user<br />

request. Although it is possible <strong>to</strong> directly access a function via its overlay entry<br />

number or ISAM entry number, this should not be done. <strong>The</strong> standard SVC linkage pro<strong>to</strong>col<br />

should be used <strong>to</strong> address the overlay functions since there is no guarantee that the<br />

routines servicing the overlay functions will remain in the overlay presently assigned.<br />

A user SVC request is via a RST 40 instruction which places the return address at the <strong>to</strong>p<br />

of the stack. Since the process <strong>to</strong> translate the user request <strong>to</strong> a system overlay request<br />

also uses a RST instruction (<strong>to</strong> minimize the length of the translation code), an extra<br />

return address is placed on the stack. <strong>The</strong> SVC processor adjusts for this by popping the<br />

extraneous return address when it is processing a system overlay request. <strong>The</strong> system's<br />

request is easily identifiable since all system request codes have bit-7 set. Because of<br />

this, if a user requests a system overlay function directly, it is necessary <strong>to</strong> CALL the<br />

RST instruction so that the return address that is kept on the stack is a pointer <strong>to</strong> the<br />

address following the CALL instruction. System overlays one through five and nine through<br />

thirteen, can be loaded in<strong>to</strong> the overlay region by means of the following code:<br />

LD A,8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!