[comp.sys.mac] LSC 1.02 Interfaces

clubmac@runx.OZ (Sydney University Macintosh Society) (12/29/86)

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 :-

1) MacinTalk - I have tried RelConv'ing SpeechAsm.Rel -> no luck with calls
2) Graf3D    - "  "     "        "      Graf3D.Rel    -> "    "   "     "

Also, has anybody got any *working* LSC code for using the List Manager? I
have made no inroads - have you?

Finally, has anyone heard of an Arabic (read - right-to-left) WP?

Thanks in advance,
		Jason Haines

tim@ism780c.UUCP (Tim Smith) (01/01/87)

LightspeedC 2.? *is* available now.  My copy arrived December 26th.
I suppose we get it here in the United States before you people in
Australia get it, but I suppose you can always just throw another
shrimp on the barbie or something while you wait... :-)
-- 
Religion: just say "no"

Tim Smith       USENET: sdcrdcf!ism780c!tim   Compuserve: 72257,3706
                Delphi or GEnie: mnementh

mlr0@bunny.UUCP (Martin Resnick) (01/02/87)

In article <546@runx.OZ>, clubmac@runx.OZ (Sydney University Macintosh Society) writes:
> 
> Since Lightspeed C Version 2.0 is not yet available,  [...]

Lightspeed C version 2.01 updates have been shipped to all registered owners.

dwb@well.UUCP (David W. Berry) (01/02/87)

Actually, if you've registered your older version of Lightspeed C
you should be receiving version 2.0 in the mail any day now.  I and
several others in the bay area already have.  2.0 has the List manager
interface built in so you shouldn't have any problems with that.

For right to left word processing their is something called, believe
it or not, "Right-To-Left" or something very close to that.  Sorry I
don't have more details.  Call ComputerWare, if they don't still
carry they at least used to.

	
-- 
	David W. Berry
	dwb@well.uucp                   dwb@Delphi
	dwb@GEnie                       293-0752@408.MaBell

fdot@sphinx.UUCP (01/06/87)

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_

jimc@iscuva.UUCP (Jim Cathey) (01/12/87)

In article <1018@sphinx.UChicago.UUCP> fdot@sphinx.UUCP (Tom Lippincott) writes:
>           ... 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
>

Ick!!!!  Be warned that anything you write with this hack will probably FAIL
on a 68020 machine due to the prefetch effect of the cache.  Self modifying
code is usually something to be avoided, but if you must do it you've got to
take into account prefetch queues, caches, et. al.  If you must do this, try
pushing your calculated code onto the stack and calling it there.  

Also, if LSC works like Aztec, the caller deallocates the pushed parameters
when the callee returns.  Since the above fragment eats the trap word you
should expect the stack to get hosed.

+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC Systems Corp.
! II      CC     !  Spokane, WA
! IISSSS  CC     !  UUCP: ihnp4!tektronix!reed!iscuva!jimc
! II      CCCCCC !  (509)927-5757
+----------------+
			"With excitement like this, who is needing enemas?"