[ql-users] Re: Executable Things in C68 (or otherwise)

2004-10-21 Thread James Hunkins
Forgot to mention, wasn't there an article or two about using C68 to 
work with Things in Ql Today?  I couldn't find them when I scanned old 
copies but...

I did see Jochen's articles (but only 3 - was there a 4th) back in 
Volume 4 I believe.

Thanks,
jim
On Oct 21, 2004, at 1:45 AM, James Hunkins wrote:
Another request for help - this time in coverting most of QDT into 
executable things.

I am writing it in C68 and I see that C68 has all the calls and 
structures to link in new Things and access them.  But the questions 
are:

1) how can I make an executable piece of code generated with C68 into 
an Executable thing that I can load into memory and link into the 
thing list

2) how would I pass parameters to it?
3) do I have to generate separate data space for each instance of an 
executable being used or would the normal C variables be isolated from 
different calls to the same executable code.

Without doing things, QDT will end up with a lot of duplicate code 
(every open folder and every desktop icon calls an executable 
presently).

Thanks,
jim
___
QL-Users Mailing List
http://www.quanta.org.uk/mailing.htm


Re: [ql-users] Executable Things in C68 (or otherwise)

2004-10-21 Thread Wolfgang Lenerz
On 21 Oct 2004 at 1:45, James Hunkins wrote:

 1) how can I make an executable piece of code generated with C68 into 
 an Executable thing that I can load into memory and link into the thing 
 list

When making FiFi, I had such a problem quite some time ago. What I 
wanted was for the user to be able to load FiFi via LRESPR (instead 
of exec) and then have the thing set up all by itself.

I've included the assembler file to do that, perhaps you can adjust it 
and prepend it your code?

However, I don't know to what extent C68 writes truly relocatable 
code, or needs some kind of relocator to be run as the first part of it 
(??) which would really be a big problem for things that aren't 
executed as such (??).

 
 2) how would I pass parameters to it?

This could have been a problem.
IIRC, the normal keywords to execute things don't allow you pass 
parameters to them.

The way to do it would be to set up a job and pass it the parameters 
on the stack, in the normal way done by EX etc...
Again, a long time ago I wrote something like that (EXEP), perhaps it 
is of use to you - appended.

 3) do I have to generate separate data space for each instance of an 
 executable being used or would the normal C variables be isolated from 
 different calls to the same executable code.

I don't know the C compiler well enough for that; but I don't think it will 
have separate vars for the programs - they would all share the same 
variables. That can be good or bad, depending on what you want . If 
in doubt, go for a separate dataspace.

Hope this helps


Wolfgang
(NB - I make no guarantee that the code works, even though the fifi 
one has been in use for ages IIRC EXEP also worked OK).
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

    File information ---
 File:  thing.asm
 Date:  21 Oct 2004, 14:55
 Size:  2476 bytes.
 Type:  Program-source
***
*

*   syntax: EXEP thingname$ [{,#chan,#chan.}][;options$]
*   optionalchannel
*   optionaloptions$
*   NOTE the separators: , or ;
*   same for EXEP_W
*   syntax: result= EXEPF(thingname$ {,#chan,#chan.}{;options$})
*   optionalchannel
*   optionaloptions$
*   same for EXEPF_W
*   result is the error passed back...
*   these will EXEcute the thing, passing it the parameters on stack
*
*   #chan MUST be preceded by the #
*
*
*   v. 1.03 1996 Apr 01 13:15:41
*
*    W. Lenerz  1992
*
***

section file_bas

xrefuse_thg
xreffree_thg
xrefget_thvect
xrefdo_vect
xrefget_str
xrefget_str2
xrefrt_int  ; returns integer
xrefgu_achp
xrefgu_rchp
XDEFfexw
XDEFfexf
XDEFfexfw
XDEFfex

fexfw   BSR.S   fexw
BRA.S   fexf2
fexfBSR.S   fex ; do the work now
fexf2   MOVE.W  D0,D4   ; return parameter
JMP rt_int  ; return an integer

fexwMOVEQ   #-1,D7
BRA.S   fex2
fex MOVEQ   #0,D7
fex2MOVEQ   #0,D5   ; preset no channel
CMP.L   A3,A5
BEQ fxbp
MOVEM.L A3/A5,-(A7) ; keep pointer to prameters
MOVEQ   #6,D4   ; D4 will hold bytes to add
loop1   ADDQ.L  #8,A3
CMP.L   A3,A5   ; only one param (thing name) ?
BEQ.S   nothing ; yes -...
MOVE.B  -7(A6,A3.L),D1  ; type byte
ANDI.B  #%0111,D1   ; filter separator
MOVE.B  D1,D2   ; keep
CMP.B   #%0001,D1   ; was separator ','?
BNE.S   opt_string  ; no, so must be options string-...
BTST#7,1(A6,A3.L)   ; yes was ',' so was it preceded by #?
BEQ fxbp2   ; no, so error!
ADDQ.W  #4,D4   ; one more channel
BRA.S   loop1   ; find out how many bytes we need
opt_string CMP.B#%0010,D2   ; was separator ';'?
BNE fxbp2   ; no! error-...
nothing MOVEQ   #100,D0
BSR gu_achp
BNE fexout2 ; leave if error
MOVE.L  (A7),A3 ; ptr to pram
MOVEQ   #100,D0 ; max length of thing name
BSR get_str ; get this string (thing name) now
MOVE.L  A0,A5   ; A5 = my space
thex1   BSR use_thg ; try to use this thing
BNE free_sp2 

Re: [ql-users] QL2004

2004-10-21 Thread Marcel Kilgus
Tony Firshman wrote:
 (I thought Tony was going to get lynched when he ordered other
 users off the line to make way for Jon Dent's presentation,
 That is a mite hard.  I thought the whole point of the internet
 connection was for Jon's demonstration.  We had the internet connection
 from about 10:30, and Jon took over the line at about 16:00.
 Marcel was worried for a while, but not about the internet connection.
 He thought the local network was going down, but that remained all the
 time.

True. I didn't really use the internet connection much, but I did
debug other QPC laptops over the Wifi LAN (one of which didn't even
have a regular cable based connector, so Wifi was the only way) and I
feared that the access point would be shut off, too.

Marcel

___
QL-Users Mailing List
http://www.quanta.org.uk/mailing.htm