Re: [fpc-pascal]RE: XTest extension for fpc

2004-03-18 Thread Rainer Hantsch
Hi!

Only a question of interest:
Are you trying to get FPC compiling X11 apps?


On Wed, 17 Mar 2004, Marc Santhoff wrote:

| Am Mi, den 17.03.2004 schrieb Jeff Pohlmeyer um 08:05:
| > > Has anyone translated the XTest xtension of XFree86 to pascal yet?
| >
| > I think it would look something like this:
| [...]
| >
| > ( compiles, but not tested )
|
| I have only tested 'XTestFakeKeyEvent' so far and it does work!
|
| Besides linking against Xtst (fpc -k-lXtst ...) there is only the
| problem of recoding chars to XKeySym's, but I think this is possible.
|
| Bye and a big thanks again,
| Marc
|
|
|
| ___
| fpc-pascal maillist  -  [EMAIL PROTECTED]
| http://lists.freepascal.org/mailman/listinfo/fpc-pascal
|


mfg

  Ing. Rainer Hantsch

-- 
.-.
|  \\|//  Ing. Rainer HANTSCH  -  Hardware + Software |
|  (o o)Service - Support - WEB-Design und Programmierung |
|--oOOo-(_)-oOOo--|
| Ing. Rainer HANTSCH |  mail: [EMAIL PROTECTED]   |
| Khunngasse 21/20|   www: http://www.hantsch.co.at   |
| A-1030 Vienna   |   tel: +43-1-79885380fax: +43-1-798853818 |
| ** A u s t r i a ** | handy: +43-664-9194382   UID-Nr: ATU 11134002 |
'-'


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Modifying cpu registers while in turbo pascal interrupt routine ?

2004-03-18 Thread Klaus Hartnegg
> Turbo pascal 7 has the 'interrupt' directive which can be placed behind a
> procedure name to turn it into a interrupt handler.

forget it, it's a bug
it doesn't save all registers (so your program will crash if it uses longint)
and it doesn't provide a stack (so your programm will crash even it it doesn't 
use longint).

> The problem is that these parameters are probably passed 'by value'. So
> these are only copies.

try trapint.pas from this page:
http://www.brain.uni-freiburg.de/~klaus/pascal/sources/

hope this helps,
Klaus
-- 
Klaus Hartnegg, Brain Research Group, University Freiburg, 
Hansa-strasse 9a, D-79104 Freiburg, Germany, [EMAIL PROTECTED]
Please avoid sending me Word attachments (use txt, rtf, or pdf).
See http://www.fsf.org/philosophy/no-word-attachments.html


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]RE: XTest extension for fpc

2004-03-18 Thread Marc Santhoff
Am Do, den 18.03.2004 schrieb Rainer Hantsch um 10:40:
> Hi!
> 
> Only a question of interest:
> Are you trying to get FPC compiling X11 apps?

Nope, I;m not trying but doing it actually. ;)

Yes, ask questions, if you like to.

Bye,
Marc




___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]wow quite cool example you made there :)

2004-03-18 Thread Nikolay Nikolov
Harald Houppermans wrote:

WOW very interesting indeed

I thought you did it like this:

asm
 mov CS, blabla
 mov IP, blabla
end
But now I see !!!

You are actually using the parameters:

CS := blabla; :)
IP := blabla; :)
 

Those interrupt parameters actually allow something which otherwise isn't
allowed ?!
The CS and IP parameters access the return address stored on the stack. 
(so after the iretd it will continue executing from there) In 16-bit DOS 
you can even simulate multithreading using this. Just hook int8 and 
store the CS/IP and all the other registers for the current thread and 
load CS/IP/registers of the next thread to be executed. Alas I didn't 
find a way to do that in 32-bit DPMI. :)

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Modifying cpu registers while in turbo pascal interrupt routine ?

2004-03-18 Thread Harald Houppermans

- Original Message - 
From: "Klaus Hartnegg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 18, 2004 9:02 AM
Subject: Re: [fpc-pascal]Modifying cpu registers while in turbo pascal
interrupt routine ?


> > Turbo pascal 7 has the 'interrupt' directive which can be placed behind
a
> > procedure name to turn it into a interrupt handler.
>
> forget it, it's a bug
> it doesn't save all registers (so your program will crash if it uses
longint)

Yes I read this somewhere else... It doesn't store the high word of the 32
bit registers like eax, ebx, etc.

So as long as I don't use longint's it should be ok.

> and it doesn't provide a stack (so your programm will crash even it it
doesn't
> use longint).

Euhm... why will it crash ?

Let me gues... if I call other routines from inside the interrupt routine ?

That seems logical... since call routines requires a stack to be present...
the push stuff on it etc and pop it back.

Euhm it's a little bit weird that it hasn't a stack... are you absolutely
sure about that ?

( Proving it would be best :D )

Anyway is that right ? calling other procedures/functions will make it crash
?

So as long as no other procedures and functions are called it should work...
or is there still another way to make it crash because it doesnt have a
stack ?

>
> > The problem is that these parameters are probably passed 'by value'. So
> > these are only copies.
>
> try trapint.pas from this page:
> http://www.brain.uni-freiburg.de/~klaus/pascal/sources/
>
> hope this helps,
> Klaus
> -- 
> Klaus Hartnegg, Brain Research Group, University Freiburg,
> Hansa-strasse 9a, D-79104 Freiburg, Germany, [EMAIL PROTECTED]
> Please avoid sending me Word attachments (use txt, rtf, or pdf).
> See http://www.fsf.org/philosophy/no-word-attachments.html
>
>
> ___
> fpc-pascal maillist  -  [EMAIL PROTECTED]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]wow quite cool example you made there :)

2004-03-18 Thread Harald Houppermans

- Original Message - 
From: "Nikolay Nikolov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 18, 2004 12:04 PM
Subject: Re: [fpc-pascal]wow quite cool example you made there :)


> Harald Houppermans wrote:
>
> >WOW very interesting indeed
> >
> >I thought you did it like this:
> >
> >asm
> >  mov CS, blabla
> >  mov IP, blabla
> >end
> >
> >But now I see !!!
> >
> >You are actually using the parameters:
> >
> >CS := blabla; :)
> >IP := blabla; :)
> >
> >
> >Those interrupt parameters actually allow something which otherwise isn't
> >allowed ?!
> >
> The CS and IP parameters access the return address stored on the stack.
> (so after the iretd it will continue executing from there) In 16-bit DOS
> you can even simulate multithreading using this. Just hook int8 and
> store the CS/IP and all the other registers for the current thread and
> load CS/IP/registers of the next thread to be executed. Alas I didn't
> find a way to do that in 32-bit DPMI. :)

Hmm... so one just keeps cycling like in a circle... hmm

So no problems with losing stuff ?

But euhm... how to exit the program without crashing ?

>
>
> ___
> fpc-pascal maillist  -  [EMAIL PROTECTED]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Modifying cpu registers while in turbo pascal interrupt routine ?

2004-03-18 Thread Nikolai Zhubr
Hi,
Thursday, 18 March, 2004, 18:26:04, Harald Houppermans wrote:
[...]
>> forget it, it's a bug
>> it doesn't save all registers (so your program will crash if it uses
> longint)

> Yes I read this somewhere else... It doesn't store the high word of the 32
> bit registers like eax, ebx, etc.
TP7 only uses 16-bit regs, for longints too, hence no need to
save/restore higher words.

>> and it doesn't provide a stack (so your programm will crash even it it
> doesn't
>> use longint).
Of course interrupt handler will have some stack, though it is
usually rather small (like all things in 16-bit world ;)
Built-in stack checking won't work properly though indeed.

> Euhm... why will it crash ?
> Let me gues... if I call other routines from inside the interrupt routine ?
No. If you re-enter non-reenterable code like DOS services,
say try to open some file without special care.
This is getting too much off-topic I guess...
-- 
Best regards,
 Nikolai Zhubr

> That seems logical... since call routines requires a stack to be present...
> the push stuff on it etc and pop it back.

> Euhm it's a little bit weird that it hasn't a stack... are you absolutely
> sure about that ?

> ( Proving it would be best :D )

> Anyway is that right ? calling other procedures/functions will make it crash
> ?

> So as long as no other procedures and functions are called it should work...
> or is there still another way to make it crash because it doesnt have a
> stack ?

>>
>> > The problem is that these parameters are probably passed 'by value'. So
>> > these are only copies.
>>
>> try trapint.pas from this page:
>> http://www.brain.uni-freiburg.de/~klaus/pascal/sources/
>>
>> hope this helps,
>> Klaus
>> -- 
>> Klaus Hartnegg, Brain Research Group, University Freiburg,
>> Hansa-strasse 9a, D-79104 Freiburg, Germany, [EMAIL PROTECTED]
>> Please avoid sending me Word attachments (use txt, rtf, or pdf).
>> See http://www.fsf.org/philosophy/no-word-attachments.html
>>
>>
>> ___
>> fpc-pascal maillist  -  [EMAIL PROTECTED]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>


> ___
> fpc-pascal maillist  -  [EMAIL PROTECTED]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Modifying cpu registers while in turbo pascal interrupt routine ?

2004-03-18 Thread Harald Houppermans

- Original Message - 
From: "Nikolai Zhubr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 12:07 AM
Subject: Re: [fpc-pascal]Modifying cpu registers while in turbo pascal
interrupt routine ?


> Hi,
> Thursday, 18 March, 2004, 18:26:04, Harald Houppermans wrote:
> [...]
> >> forget it, it's a bug
> >> it doesn't save all registers (so your program will crash if it uses
> > longint)
>
> > Yes I read this somewhere else... It doesn't store the high word of the
32
> > bit registers like eax, ebx, etc.
> TP7 only uses 16-bit regs, for longints too, hence no need to
> save/restore higher words.

Huh ? A longint is 32 bit in tp7 if I am not mistaking ?

Say how does it work then... TP7 using two 16 bit registers for longints...

Why can't one use longints inside interrupt routines ? wacky.


>
> >> and it doesn't provide a stack (so your programm will crash even it it
> > doesn't
> >> use longint).
> Of course interrupt handler will have some stack, though it is
> usually rather small (like all things in 16-bit world ;)
> Built-in stack checking won't work properly though indeed.

What is stack checking ?



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]wow quite cool example you made there :)

2004-03-18 Thread Harald Houppermans

- Original Message - 
From: "Nikolay Nikolov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 18, 2004 12:04 PM
Subject: Re: [fpc-pascal]wow quite cool example you made there :)


> Harald Houppermans wrote:
>
> >WOW very interesting indeed
> >
> >I thought you did it like this:
> >
> >asm
> >  mov CS, blabla
> >  mov IP, blabla
> >end
> >
> >But now I see !!!
> >
> >You are actually using the parameters:
> >
> >CS := blabla; :)
> >IP := blabla; :)
> >
> >
> >Those interrupt parameters actually allow something which otherwise isn't
> >allowed ?!
> >
> The CS and IP parameters access the return address stored on the stack.
> (so after the iretd it will continue executing from there) In 16-bit DOS
> you can even simulate multithreading using this. Just hook int8 and
> store the CS/IP and all the other registers for the current thread and
> load CS/IP/registers of the next thread to be executed. Alas I didn't
> find a way to do that in 32-bit DPMI. :)

wdosx/dwpl found a way to do that... maybe you should take a look at that :D

Though it's website got hacked twice in one week :D


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal