Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!lll-lcc!mordor!sri-spam!sri-unix!rutgers!princeton!allegra!ulysses!mhuxt!ihnp4!gargoyle.uchicago.edu!sphinx!fdot
From: fdot@sphinx.UUCP
Newsgroups: comp.sys.mac
Subject: Re: LSC 1.02 Interfaces
Message-ID: <1018@sphinx.UChicago.UUCP>
Date: Mon, 5-Jan-87 18:39:03 EST
Article-I.D.: sphinx.1018
Posted: Mon Jan  5 18:39:03 1987
Date-Received: Tue, 6-Jan-87 22:35:40 EST
References: <546@runx.OZ>
Reply-To: fdot@sphinx.UUCP (Tom Lippincott)
Organization: Univ. of Chicago Computation Center
Lines: 56

In article <546@runx.OZ> clubmac@runx.UUCP writes:
>
>Since Lightspeed C Version 2.0 is not yet available, I wanted to ask people
>on the net who use LSC 1.02 whether they have Libraries/Headers for
>interfacing to :-
[...]
>Finally, has anyone heard of an Arabic (read - right-to-left) WP?
>
>Thanks in advance,
>		Jason Haines

I note from a later article that you did get 2.0, but for those of us who
are still expecting (just me?) and others who might be interested, I wrote
a short, thouroughly hacked bit of code to call an arbitrary trap from LSC,
and I think it went like this (sorry, my source isn't handy):

calltrap
wcalltrap
lcalltrap
start	move.l	(sp)+,d0	;pop the return adress
	move.l	d0,end+2	;store it to be jumped to
	move.w	(sp)+,d0	;pop the trap word
	move.w	d0,trap		;set up trap
trap	nop			;do it
end	jmp	0		;return

This takes advantage of the variable-number-of-parameters feature of C to
let you call it like this:

extern void calltrap();
extern int  wcalltrap();
extern long lcalltrap();

calltrap( trapnumber, routine parameters... );

although the same code works in each case, it needs three declarations to
work on all sizes of return values.

you can then use it to write interfaces to most anything in IM, and maybe even
in the next set of additions.

By all means, check this against the IM and LSC assembly sections before
using it -- my memory isn't always very reliable.

Also, I met someone last summer who showed me a patch he'd written to
convert MacWrite to right-to-left (for Hebrew, not Arabic, but I expect the
principle is the same).  I think it was installed and removed
through a DA, and that he said it was public domain and available through
the Boston Computer Society, but asked for a donation to MIT's Hillel
House.  Or maybe available through Hillel, but asked for a donation to
the BCS?

					--Tom Lippincott
					..ihnp4!gargoyle!sphinx!fdot

"Oh Yeah!  Sez who?"  -- Immanuel Kant, _The Critique of Pure Reason_