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

2004-03-17 Thread Marc Santhoff
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:
> 
> unit XTest;

[...code snipped...]

> ( compiles, but not tested )
> 
>  - Jeff

It does compile. Wow!

So I'll go testing, stay tuned for the result ...

Thank you, Jeff.

Bye,
Marc


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


Re: [fpc-pascal]exception handling

2004-03-17 Thread Thomas Schatzl
Hi again,

> > spent a few moments going over the docs in the manual re: exception
> > handling. for some reason it just doesn't seem to be sinking in, as
> > nothing i've tried as of yet has managed to stop prog from crashing when
> > data in input that's of a different type than program is expecting
> > (string as opposed to integer, for example).
>
> [...]
>
> - did you include the sysutils unit?
> - afaik readln just raises runtime error which is unspecified according to
> the docs; eventually an EIOError (or similar if this does not exist)
because
> this behaviour can be turned on/off with $I+/-.
> But to be sure, you might want to catch general exceptions.
> - do the following:
>
> s: String;
> i : Integer;
> code : Word;
>
> try
> readln(s);
> i := StrToInt(s);
> catch
> on EIOError ...
> end;

Obviously it should mean "on EConvertError..." here because StrToInt raises
an EConvertError when the string does not represent a valid integer (see
docs)
Not an EIOError, this one probably slipped in because I was talking about
catching an I/O Error in the other variants...

Sorry,
  Thomas


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


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

2004-03-17 Thread Marc Santhoff
Am Mi, den 17.03.2004 schrieb Marc Santhoff um 10:18:
[...]
> It does compile. Wow!
> 
> So I'll go testing, stay tuned for the result ...

It is only stupid rubbish, but i works.

For reference i use the source of the tool "xte" from the "xautomation"
suite (see: http://hoopajoo.net/projects/xautomation.html).

Look:

program xtesttest;

uses sysutils, x, xlib, XTest;
var
toSend : AnsiString;
ch : AnsiString;
i  : integer;
dpy: PDisplay;
ks : TKeySym;
kc : TKeyCode;

BEGIN
dpy := XOpenDisplay(NIL);
if NOT(dpy = NIL) then begin
toSend := 'lalalalala';
for i:= 0 to length(toSend)-1 do begin
ch := copy(toSend,i+1,1);
writeln(ch);
ks := XStringToKeysym(pchar(ch));
kc := XKeySymToKeycode( dpy, ks );
XTestFakeKeyEvent( dpy, kc, longint(TRUE), CurrentTime );
XTestFakeKeyEvent( dpy, kc, longint(FALSE), CurrentTime );
end;

XCloseDisplay( dpy );
end;

END.

As already written, link against Xtst (fpc -k-lXtst ...).

Have fun,
Marc


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


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

2004-03-17 Thread Marc Santhoff
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


Re: [fpc-pascal]exception handling

2004-03-17 Thread kractor
Thomas Schatzl wrote:

Hi again,

 

spent a few moments going over the docs in the manual re: exception
handling. for some reason it just doesn't seem to be sinking in, as
nothing i've tried as of yet has managed to stop prog from crashing when
data in input that's of a different type than program is expecting
(string as opposed to integer, for example).
 

[...]

- did you include the sysutils unit?
- afaik readln just raises runtime error which is unspecified according to
the docs; eventually an EIOError (or similar if this does not exist)
   

because
 

this behaviour can be turned on/off with $I+/-.
But to be sure, you might want to catch general exceptions.
- do the following:
s: String;
i : Integer;
code : Word;
try
   readln(s);
   i := StrToInt(s);
catch
   on EIOError ...
end;
   

Obviously it should mean "on EConvertError..." here because StrToInt raises
an EConvertError when the string does not represent a valid integer (see
docs)
Not an EIOError, this one probably slipped in because I was talking about
catching an I/O Error in the other variants...
Sorry,
 Thomas
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 

thank you kindly, this worked perfectly. to be honest, the thought of 
reading the data initially as a string and then using a conversion to 
trap the error hadn't even crossed my mind ... :)

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


Re: [fpc-pascal]exception handling

2004-03-17 Thread Michael Van Canneyt


On Tue, 16 Mar 2004, kractor wrote:

> spent a few moments going over the docs in the manual re: exception
> handling. for some reason it just doesn't seem to be sinking in, as
> nothing i've tried as of yet has managed to stop prog from crashing when
> data in input that's of a different type than program is expecting
> (string as opposed to integer, for example).
>
> as i said, i'm pretty sure that its something really small and obvious,
> i'll include a few lines here ... maybe someone can spot my mistake ...
> pretty sure its the EConvertError and that there's a pre-defined error
> type that I just haven't come across yet.
>
> try
> readln(NewAlbum.Year);
> except
> on EConvertError do NewAlbum.Year := 0;
> end;

This should be:


  try
   readln(NewAlbum.Year);
  except
  on E : EConvertError do NewAlbum.Year := 0;
  end;

Michael.

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


Re: [fpc-pascal]exception handling

2004-03-17 Thread kractor
Michael Van Canneyt wrote:

On Tue, 16 Mar 2004, kractor wrote:

 

spent a few moments going over the docs in the manual re: exception
handling. for some reason it just doesn't seem to be sinking in, as
nothing i've tried as of yet has managed to stop prog from crashing when
data in input that's of a different type than program is expecting
(string as opposed to integer, for example).
as i said, i'm pretty sure that its something really small and obvious,
i'll include a few lines here ... maybe someone can spot my mistake ...
pretty sure its the EConvertError and that there's a pre-defined error
type that I just haven't come across yet.
   try
   readln(NewAlbum.Year);
   except
   on EConvertError do NewAlbum.Year := 0;
   end;
   

This should be:

 try
  readln(NewAlbum.Year);
 except
 on E : EConvertError do NewAlbum.Year := 0;
 end;
Michael.

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

tried your suggestion and when i attempted to input string when prog 
expecting integer value, it gave following error

An unhandled exception occurred at 0x004012CC :
EInOutError : Invalid input
so, i tried changing the EConvertError to EInOutError, little code paste 
follows

   try
   readln(NewAlbum.Year);
   except
   on E : EInOutError do NewAlbum.Year := 0;
   end;
   write('label: ');
   readln(NewAlbum.alLabel);
   write('tracks: ');
   readln(NewAlbum.NumTracks);
what's happening now is that when "invalid" data type is entered which 
triggers the exception handle, the program is "skipping" the 
readln(NewAlbum.alLabel) command and resuming apparently normal 
operations on the very next line [write('tracks: ');]. when valid data 
is entered, the program naturally doesn't trigger the exception handle 
and everything works normally.

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


Re: [fpc-pascal]exception handling

2004-03-17 Thread vkrish



> >
> > try
> > readln(NewAlbum.Year);
> > except
> > on EConvertError do NewAlbum.Year := 0;
> > end;
> 
> This should be:
> 
> 
>   try
>readln(NewAlbum.Year);
>   except
>   on E : EConvertError do NewAlbum.Year := 0;
>   end;
> 
What are the costs of using exceptional handling ? Is the overhead similar to that 
incurred by C++ programs ?

cheers,
-Krish


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


Re: [fpc-pascal]exception handling

2004-03-17 Thread Michael Van Canneyt


On Wed, 17 Mar 2004, kractor wrote:

> Michael Van Canneyt wrote:
>
> >On Tue, 16 Mar 2004, kractor wrote:
> >
> >
> >
> >>spent a few moments going over the docs in the manual re: exception
> >>handling. for some reason it just doesn't seem to be sinking in, as
> >>nothing i've tried as of yet has managed to stop prog from crashing when
> >>data in input that's of a different type than program is expecting
> >>(string as opposed to integer, for example).
> >>
> >>as i said, i'm pretty sure that its something really small and obvious,
> >>i'll include a few lines here ... maybe someone can spot my mistake ...
> >>pretty sure its the EConvertError and that there's a pre-defined error
> >>type that I just haven't come across yet.
> >>
> >>try
> >>readln(NewAlbum.Year);
> >>except
> >>on EConvertError do NewAlbum.Year := 0;
> >>end;
> >>
> >>
> >
> >This should be:
> >
> >
> >  try
> >   readln(NewAlbum.Year);
> >  except
> >  on E : EConvertError do NewAlbum.Year := 0;
> >  end;
> >
> >Michael.
> >
> >___
> >fpc-pascal maillist  -  [EMAIL PROTECTED]
> >http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> >
> >
> >
> tried your suggestion and when i attempted to input string when prog
> expecting integer value, it gave following error
>
> An unhandled exception occurred at 0x004012CC :
> EInOutError : Invalid input
>
> so, i tried changing the EConvertError to EInOutError, little code paste
> follows
>
> try
> readln(NewAlbum.Year);
> except
> on E : EInOutError do NewAlbum.Year := 0;
> end;
> write('label: ');
> readln(NewAlbum.alLabel);
> write('tracks: ');
> readln(NewAlbum.NumTracks);
>
> what's happening now is that when "invalid" data type is entered which
> triggers the exception handle, the program is "skipping" the
> readln(NewAlbum.alLabel) command and resuming apparently normal
> operations on the very next line [write('tracks: ');]. when valid data
> is entered, the program naturally doesn't trigger the exception handle
> and everything works normally.

I have been able to reproduce this. However, I'm not sure what the cause
it. My guess is that the end-of-line is not consumed before the
exception is raised, and therefore the

readln(NewAlbum.alLabel);

line gets an empty input line. Delphi does consume the end-of-line, and
waits for the input of the label.

This is a very tricky issue, I think the core FPC list needs to discuss
it.

For the moment, I would do like this;

Var
  A : String;

begin
 readln(A);
 NewAlbum.Year:=StrToIntDef(A,0);
 write('label: ');
 readln(NewAlbum.alLabel);
 write('tracks: ');
 readln(NewAlbum.NumTracks);

This avoids the exception.

Michael.

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


Re: [fpc-pascal]win32 make install error

2004-03-17 Thread Vincent Snijders
On Sun, 04 Jan 2004 13:01:24 -0500
kractor <[EMAIL PROTECTED]> wrote:

> i've managed to (mostly) work out the problems i had building latest 
> cvs. make cycle runs nicely, make all completes w/o crashing, but when i 
> attempt a "make install" the following happens ...
> 
> c:/pp/bin/win32/cp.exe -rfp tests/* /pp/examples/fcl
> cp.exe: cannot remove old link to `/pp/examples/fcl/Makefile': 
> Permission denied
> 
> cp.exe: cannot remove old link to `/pp/examples/fcl/Makefile.fpc': 
> Permission de
> nied
> make[3]: *** [fpc_exampleinstall] Error 1
> make[3]: Leaving directory `C:/CVS/fpc/fcl/db'
> make[2]: *** [db_exampleinstall] Error 2
> make[2]: Leaving directory `C:/CVS/fpc/fcl'
> make[1]: *** [fcl_distinstall] Error 2
> make[1]: Leaving directory `C:/CVS/fpc'
> make: *** [install] Error 2
> 
> however, after this fails i can type ppc386 -i from anywhere and i get 
> the following which leads me to believe that everything went ok ...
> 
> Free Pascal Compiler version 1.9.2
> 
> Compiler Date  : 2004/01/04
> 
> not really sure that these errors are something i need to be concerned 
> with, but i wouldn't think an error that causes the install process to 
> terminate is something i should ignore ... :)
Recently I switched to windows xp for building from cvs. I had also these kind
of troubles, except it stopped the installation. So compiler where updated, but
it failed on updating the error message files, and there no fresh rtl was
installed, which was troublesome. You think are have up to date libraries, but
instead you are still working with the old ones.

I found out that the files, which cp.exe couldn't overwrite were marked
read-only. So I removed the read-only flag from all those (installed) files and
from all the file I had downloaded from cvs. WinCVS default to checking out
read-only, which is not the 'right' way.

Maybe this solves these kind of problems for others too, so I send it to the
list so that it can be found in the mailing list  achives.

Regards,
Vincent.

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


Re: [fpc-pascal]exception handling

2004-03-17 Thread kractor
Michael Van Canneyt wrote:

I have been able to reproduce this. However, I'm not sure what the cause
it. My guess is that the end-of-line is not consumed before the
exception is raised, and therefore the
   readln(NewAlbum.alLabel);

line gets an empty input line. Delphi does consume the end-of-line, and
waits for the input of the label.
This is a very tricky issue, I think the core FPC list needs to discuss
it.
For the moment, I would do like this;

Var
 A : String;
begin
readln(A);
NewAlbum.Year:=StrToIntDef(A,0);
write('label: ');
readln(NewAlbum.alLabel);
write('tracks: ');
readln(NewAlbum.NumTracks);
This avoids the exception.

if there's anyting anyone needs from me on this, feel free to let me 
know. since you've indicated that you've been able to reproduce the 
error i'll assume you won't need the code that I have. however, should 
that be needed i'd be more than happy to send it.

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


[fpc-pascal]Can't build FCL

2004-03-17 Thread Michael A. Hess
Greetings,

In trying to make a new compiler it fails when I try to build the FCL. 
The make is trying to enter a directory fcl/db/sdf but there isn't any 
such directory. Is something not committed to CVS?

--
 Programming my first best destiny! 
Michael A. Hess  Miracle Concepts, Inc.
[EMAIL PROTECTED]   http://www.miraclec.com
Phone: 570-388-2211  Fax: 570-388-6101
___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Can't build FCL

2004-03-17 Thread Jonas Maebe
On 17 mrt 2004, at 20:45, Michael A. Hess wrote:

In trying to make a new compiler it fails when I try to build the FCL. 
The make is trying to enter a directory fcl/db/sdf but there isn't any 
such directory. Is something not committed to CVS?
Make sure you use "cvs up -d" so you get new directories committed to 
cvs as well.

Jonas

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


Re: [fpc-pascal]Can't build FCL

2004-03-17 Thread Michael A. Hess
On Wed, 17 Mar 2004, Jonas Maebe wrote:

> > The make is trying to enter a directory fcl/db/sdf but there isn't any
> > such directory. Is something not committed to CVS?
>
> Make sure you use "cvs up -d" so you get new directories committed to
> cvs as well.

I always do. Hmmm. Unless the default for that got changed somehow. I
usually have it as the default setting but I didn't look at it when I did
the update.

I can't get on that machine right now to check, I'll have to do it a
little later when I can get back on it.

Never thought of checking to make sure of the setting since that is how I
always do it.

-- 
 Programming my first best destiny! 

Michael A. Hess  Miracle Concepts, Inc.
[EMAIL PROTECTED]   http://www.miraclec.com
Phone: 570-388-2211  Fax: 570-388-6101


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


Re: [fpc-pascal]Can't build FCL

2004-03-17 Thread Michael A. Hess
On Wed, 17 Mar 2004, Michael A. Hess wrote:

> On Wed, 17 Mar 2004, Jonas Maebe wrote:
>
> > > The make is trying to enter a directory fcl/db/sdf but there isn't any
> > > such directory. Is something not committed to CVS?
> >
> > Make sure you use "cvs up -d" so you get new directories committed to
> > cvs as well.
>
> I always do. Hmmm. Unless the default for that got changed somehow.

Do. My bad.

Somehow the default setting got changed and it wasn't donig a new
directory grab. Sorry about that.

-- 
 Programming my first best destiny! 

Michael A. Hess  Miracle Concepts, Inc.
[EMAIL PROTECTED]   http://www.miraclec.com
Phone: 570-388-2211  Fax: 570-388-6101


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


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

2004-03-17 Thread Harald Houppermans
Hi,

Maybe you guys know something about good old turbo pascal :D

Turbo pascal 7 has the 'interrupt' directive which can be placed behind a
procedure name to turn it into a interrupt handler.

procedure interrupt_handler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES,
BP: Word); interrupt;
begin


end;

All cpu registers will be copied into these parameters.

The documentation says that after the interrupt routine is done all these
parameters will be stored back into the cpu registers.

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

When modifieing these parameters it is useless (?) because they are not
placed back into the cpu registers ???

Is that true... ?

How does one write a decent interrupt routine for turbo pascal where cpu
registers can be modified... since the driver which calls the interrupt
routine excepts certain cpu registers to be changed/set. For example to
buffers.

Skybuck.

___
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-17 Thread Harald Houppermans
Actually it is for a packet driver in dos.

Maybe I have to manually set the interrupt routine in the interrupt vector
table or will the packet driver do that ?


___
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-17 Thread Harald Houppermans
Nope...

It seems the problem was with setting the ethernet card address.

The test program was setting the ethernet address of the network card to
decimal:

10:20:30:40:50:60

Just to test it for fun...

Somehow that prevented the network card from receiving any packets.


___
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-17 Thread Harald Houppermans
Hmmm

Now I am not sure anymore... I re-enabled the set address and it still
works...

Maybe it is now working because I did a reboot :)

Maybe the old dummy receiver or so fucked something up I dont know.

Maybe constantly changing packet driver settings is not a good idea...

Maybe the packet driver should be unloaded and then reloaded or maybe just a
fresh boot.

:)


___
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-17 Thread Harald Houppermans
Ok,

I think I have found the culprit...

The test program calls: 'reset interface' function.

This function is not working properly anyway... (it does not clear multicast
list and does not re-fetch address from rom)

Disabling this function from the test program makes it work and receive
packets :D

If a send a packet of ethernet/ip/udp and data 395... the test will show 437
bytes received...

( First I thought that can't be right ethernet is only 14 bytes :) but I
forgot the other protocol headers :) )

Hmm let's see... 14 bytes for ethernet header + 20 bytes for ip + 8 = 42
bytes.

437 - 42 = 395 matches perfectly !!! :D

Yes !!!

It seems pascal interrupts do work like they should !!! :D

I apologize for this :D lol Stupid me ! :D

Wihhhee :):):):):):):):)

Skybuck.


___
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-17 Thread Nikolai Zhubr
Hi,
Thursday, 18 March, 2004, 2:51:36, Harald Houppermans wrote:
> Actually it is for a packet driver in dos.

> Maybe I have to manually set the interrupt routine in the interrupt vector
> table or will the packet driver do that ?
I have no idea what the packet driver does but to your
original question yes, you can freely modify registers'
values passed to the interrupt procedure and new values will
have effect upon return, just like help says, and see the
attached example.
No, it doesn't matter whether you use SetIntVec or change
interrupt table by hand (though I'd not recommend the latter).
HTH.
-- 
Best regards,
 Nikolai Zhubr


> ___
> 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-17 Thread Nikolai Zhubr
Ups, forgot to actually attach it, sorry, now goes...
-- 
Best regards,
 Nikolai Zhubr

Thursday, 18 March, 2004, 4:12:09, Nikolai Zhubr wrote:
> Hi,
> Thursday, 18 March, 2004, 2:51:36, Harald Houppermans wrote:
>> Actually it is for a packet driver in dos.

>> Maybe I have to manually set the interrupt routine in the interrupt vector
>> table or will the packet driver do that ?
> I have no idea what the packet driver does but to your
> original question yes, you can freely modify registers'
> values passed to the interrupt procedure and new values will
> have effect upon return, just like help says, and see the
> attached example.
> No, it doesn't matter whether you use SetIntVec or change
> interrupt table by hand (though I'd not recommend the latter).
> HTH.uses Dos, Crt;
{$F+}
var
  Int8Save: procedure;
const
  count: longint = 0;

procedure Subst;
begin
  writeln('Here we are!');
  repeat until false;
end;

procedure TimerHandler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES, BP: Word); 
interrupt;
begin
  inc(count);
  asm
pushf;
  end;
  Int8Save;
  { Uncomment the following 2 lines and see what happens. }
{
  CS := Seg(Subst);
  IP := Ofs(Subst);
}
end;

begin
  GetIntVec(8, @Int8Save);
  SetIntVec(8, Addr(TimerHandler));
  writeln('Press ANYKEY to exit');
  repeat
write(count, ' '#13);
  until Keypressed;
  SetIntVec(8, @Int8Save);
end.


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

2004-03-17 Thread Harald Houppermans
Man... great... :)

It says so in the specification lol:

"
Resets the interface associated with handle to a known state,
aborting any transmits in process and reinitializing the -> receiver <-
"

Ofcourse I didn't know what that ment ? "reinitializing"

Could mean anything :)

Apperently it just disables the receiver...

Probably nil or so :)

That's why the receiver never gets called...

Also for most packet drivers 'packets lost' will never increase
also bytes in will never increase...

For some packet drivers this might still work...

So apperently for most packet drivers the receiver needs to be initialized
and working etc... otherwise statistics won't get updated...

( but for some it still will ? or maybe those packet drivers are buggy...
who knows :) could be anything :) ) :)





___
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-17 Thread Harald Houppermans
Thanks for your quick reply but I already solved the problem :)



___
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-17 Thread Harald Houppermans
It would be interesting to see how hard it would be to use free pascal and
16 bit packet drivers...

( Holyshit... my monitor just did weird... probably a power source... that
never happens wow, or maybe the monitor
is about to die hehehehe it's quite old :) 5 to 6 years or so... (Liyama
vision master) ohoh :)  my very old 15 inc eizo died like after 9 years or
something at my brothers place since I gave it to him.. actually he forced
me too give it to him lol hehehehehe never again ! :D I still have to get it
back lol and the pc too :D he doesnt use it anymore :D it has a very cool
56k6 ISA modem which says: 'MADE IN VIETNAM' I bought it specially for
him 100 bucks I want it back :D:D:D:D that s so cool )

Anyway...

In wdosx/dwpl it seems like quite a hassle... using real mode callbacks
etc... oh well.

Maybe in the future I come back to this mailing :D when I am realy
disperate to get something working :D

People that write 32 bit compilers must know their stuff :D :):):):):)


___
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-17 Thread Harald Houppermans
Hmmm right after this posted my cable modem went down to lol...

It's dhcp lease probably expired... It seems dhcp leases have been shortened
by my isp :) I think... :)

Like 6 days before it expires or so then I get a new one.

It would suck if that happened while testing packet drivers over the
internet or so... heheh

I'll be like wtf... why it aint working... damn.

It's like a wireless mouse running out of battery juice... you'll be like
huh ? wtf why is my system so slow mouse not responding
must be bug in my program hehehe.

I hate this fricking wireless mouses :D hehehe

yes sir !

I have a cordfull mouse ! :D yupyupyup...

They just don't make em anymore like they used too... no mouse balls
anymore... the latest mouses have like lasers
which almost blind you...  I bought the cheapest one I could find for my
parents pc... fortunately it's laser pointed forward so it doesn't blind
you when you flip it... but others do/will shine in your face hehe. The
original mouse for parents pc's did have wireless mouse I knew that when we
bought it but the package was cheap. oh fuck no lol crappy pc hehe. So I was
already planning on replacing it. The new mouse does have a wire
but it also has a laser... doh.

It was the only one I could find in the local stores.. the rest where all
wireless iieeewww. hehe.

Anybody else having that same experience ? shops having wirefull mouses only
? yak.

I hope mouse manufactures stop producing that junk quickly and turn back to
wirefull mouses :D

The salesman also said he was barely selling anything from that junk. :D

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


> It would be interesting to see how hard it would be to use free pascal and
> 16 bit packet drivers...
>
> ( Holyshit... my monitor just did weird... probably a power source... that
> never happens wow, or maybe the monitor
> is about to die hehehehe it's quite old :) 5 to 6 years or so... (Liyama
> vision master) ohoh :)  my very old 15 inc eizo died like after 9 years or
> something at my brothers place since I gave it to him.. actually he forced
> me too give it to him lol hehehehehe never again ! :D I still have to get
it
> back lol and the pc too :D he doesnt use it anymore :D it has a very cool
> 56k6 ISA modem which says: 'MADE IN VIETNAM' I bought it specially for
> him 100 bucks I want it back :D:D:D:D that s so cool )
>
> Anyway...
>
> In wdosx/dwpl it seems like quite a hassle... using real mode callbacks
> etc... oh well.
>
> Maybe in the future I come back to this mailing :D when I am realy
> disperate to get something working :D
>
> People that write 32 bit compilers must know their stuff :D :):):):):)
>
>
> ___
> 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-17 Thread Harald Houppermans
 > Anybody else having that same experience ? shops having wirefull mouses
 only
 > ? yak.
 
 Oh shit I ment wireless mouses only hehe.
 
 

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


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

2004-03-17 Thread Harald Houppermans
Wow

Did you just write this from scratch ?

That's a very cool trick you did there...

Replacing the CS ( code segment  )

And IP ( instruction pointer )

Seems like a dirty little hack lol... like a hacker could use to execute
code hehehe.

Anyway I was also wondering how to proof it...

This will proof it just fine :)

I wonder if you can also write this same example for free pascal 32 bit ?!

HEHE that will probably require a lot more code ?! :)

uses Dos, Crt;
{$F+}
var
  Int8Save: procedure;
const
  count: longint = 0;

procedure Subst;
begin
  writeln('Here we are!');
  repeat until false;
end;

procedure TimerHandler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES, BP:
Word); interrupt;
begin
  inc(count);
  asm
pushf;
  end;
  Int8Save;
  { Uncomment the following 2 lines and see what happens. }
{
  CS := Seg(Subst);
  IP := Ofs(Subst);
}
end;

begin
  GetIntVec(8, @Int8Save);
  SetIntVec(8, Addr(TimerHandler));
  writeln('Press ANYKEY to exit');
  repeat
write(count, ' '#13);
  until Keypressed;
  SetIntVec(8, @Int8Save);
end.

Skybuck.



___
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-17 Thread Harald Houppermans
> procedure Subst;
> begin
>   writeln('Here we are!');
>   repeat until false;
> end;

Lol now I understand why you placed repeat until false; lol

Without it it crashes :D hmmm

Probably no way to recover from it... hmmm

Or is there ?

Hmm maybe there is :)

Storing the CS and IP and then later going back...

But euhm that would be cheating...

Since it has to call/end the interrupt...

Hmm no it's not cheating.

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

That proofs it works :D

And recovering from it should work as well :D

CS := OLDCS;
IP := OLDIP

No lol that's not possible

var
OLDCS : word;
OLDIP : word;

> procedure Subst;
> begin
>   writeln('Here we are!');

CS := OLDCS;  // this ofcourse cant work since parameter is not
available here. unless maybe it is pushed or so i dont know.
 IP := OLDIP;

mov CS,OLDCS // cant work

mov CS,ax // cant work invalid combination

> end;

Shit :)

I still wonder if there is a way to make it recover...

Euh this is very funny.

Those interrupt parameters actually allow something which otherwise isn't
allowed ?!

Hmm. :)

>
> procedure TimerHandler(Flags, CS, IP, AX, BX, CX, DX, SI, DI, DS, ES, BP:
> Word); interrupt;
> begin
>   inc(count);
>   asm
> pushf;
>   end;
>   Int8Save;
>   { Uncomment the following 2 lines and see what happens. }

OLDCS := CS;
OLDIP := IP;

> {
>   CS := Seg(Subst);
>   IP := Ofs(Subst);
> }
> end;
>
> begin
>   GetIntVec(8, @Int8Save);
>   SetIntVec(8, Addr(TimerHandler));
>   writeln('Press ANYKEY to exit');
>   repeat
> write(count, ' '#13);
>   until Keypressed;
>   SetIntVec(8, @Int8Save);
> end.
>
> Skybuck.
>
>
>
> ___
> 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