The Function Dispatcher

See all articles from Sinc-Link v4 n5
Author(s): Mike Lemyre
Publication: Sinc-Link
Pub Details: Sinc-Link v4 n5 (Volume 4, Issue 5)
Date: September/October 1986
Pages: 10

The routine to call the function dispatcher is found on pages 214-216 of the Timex Sinclair 2068 Intermediate Advanced Guide Some people have been unsucessful in finding a use for this utility. However I was reading an article in the news letter of the Personal Computer Club of Toronto; which dealt with the I.B.M. function dispatcher when calling D.O.S functions I noticed a similiarity between the two utilities. The priciples to keep in mind are:

1. Initialize machine stack.

2. Push service code.

3. Set up registers to function requirements.

4. Call the dispatcher.

Compare these routines.

  I.B.M.          TS2068
xor ax,ax LD DE 0000
push dx push DE
push ax push DE
mov ah,2h ld DE 135
mov dl,38 push DE
int 21h ld A,38
ret call 6200
ret

Both of these routines print the & character. Some other routines that have been sucessfully called are:

Service Code     Function
    34             cls
    89             plot bc
   135             print char
   141             cls
   142             scroll

I will expand on the uses of subroutines and function calls in my next article.