1. External Modem Emulator

Thanks, Bernie, and Jeff.  I was able to get the com ports working.

Here's what I'm trying to accomplish:

I have two computers on the same desk; a P166 with a controller-less modem
(winmodem--BLEHCK), and a 486 with a 14.4k modem.  I've recently installed
Linux (Redhat 5.2) on the P166, and it won't work with the winmodem.  (I'm
still running Windows on the P166, I'm just playing around with Linux.)

So...I was thinking...what if I could redirect the input and output on the
486 so that anything coming in thru COM1 is sent out COM2, and anything
coming in thru COM2 is sent out COM1.  Now, assuming that the modem in the
486 is on COM2, if I connect the two computers via a serial cable (COM1 on
486 to COM1 on P166) then the P166 will be fooled into thinking that it's
got an external modem.  (I'm speculating, not stating fact.)

So far, it seems to be working.  I can control the 486's modem from the P166
in Windows or Linux.  Some things don't seem to work properly, but I think
it's probably because it's so slow.  One thing I don't understand is that it
will only work if I set flow control to software...it won't work on
hardware.

Now that I've explained what I'm trying to do, I was wondering if anyone can
tell me how to make it work better--or tell me that there's no chance of
getting it to work properly.  I've included the program I wrote.  It runs on
the 486.

-------------------MEMU.EX-----------------------
--Modem emulator...fools computer on other end of serial cable, into
thinking
--it owns an external modem.

--Anything that comes in com2 is sent out com1, and anything that comes in
--com1 is sent out com2.
--Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
--Pressing any key breaks out of the program.

without type_check

include serial.e

integer key,data,rcnt
sequence rBuffer    rBuffer = {}

clear_screen()
puts(1,"Modem Emulator in operation...press a key to terminate...")

SetPortBPDS(1,19200,0,8,1)  --Configure the ports
SetPortBPDS(2,19200,0,8,1)

rcnt = 0
key = -1
while key < 0 do
    data = GetSerialByte(2)  --See if modem has sent any data
    if data > 0 then
        rBuffer &= data  --Yes, so put it in buffer
        rcnt = 200   --This must be 200 in order not to lose data
    else
        rcnt = rcnt -1
    end if
    if rcnt < 1 then
        rcnt = 0
        key = get_key()   --If user has pressed a key, then exit prog
        if length(rBuffer) > 0 then   --If there's anything in buffer,
            for i = 1 to length(rBuffer) do --Send it out
                SendSerialByte(1,rBuffer[i]) --com1
            end for
            rBuffer = {}  --Empty the buffer
        end if
        data = GetSerialByte(1) --Get data from com1 (remote 'puter)
        if data > 0 then    --If any data was waiting,
            SendSerialByte(2,data) --send it to modem
        end if
    end if
end while
puts(1,"\n\nDone.\n")
-------------------------------------------------

Thanks in advance,

Ben

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view message » categorize

2. Re: External Modem Emulator

Hi This sounds like a fun project. I like electronics.
I'm wanting to build a little electronic circuit that will
automatically reboot my computer on every blue screen.
Sometimes, hackers attack my computer when running my
irc bots and I wake up the next morning to see that my computer
crashed. So I thought, why not put a phototrasistor on a certain
part of my monitor and whenever my computer crashes, the transistor
recognizes the color and triggers my reset button on my computer.
Well, I have'nt built it yet, but, I will sometime. :)

NOTE: I was wondering about your linux. I think that 14.4
modems can use lots of different drivers. Linux might have a
generic driver for 14.4 that will work. ...timmy


Ben Logan wrote:

> Thanks, Bernie, and Jeff.  I was able to get the com ports working.
>
> Here's what I'm trying to accomplish:
>
> I have two computers on the same desk; a P166 with a controller-less modem
> (winmodem--BLEHCK), and a 486 with a 14.4k modem.  I've recently installed
> Linux (Redhat 5.2) on the P166, and it won't work with the winmodem.  (I'm
> still running Windows on the P166, I'm just playing around with Linux.)
>
> So...I was thinking...what if I could redirect the input and output on the
> 486 so that anything coming in thru COM1 is sent out COM2, and anything
> coming in thru COM2 is sent out COM1.  Now, assuming that the modem in the
> 486 is on COM2, if I connect the two computers via a serial cable (COM1 on
> 486 to COM1 on P166) then the P166 will be fooled into thinking that it's
> got an external modem.  (I'm speculating, not stating fact.)
>
> So far, it seems to be working.  I can control the 486's modem from the P166
> in Windows or Linux.  Some things don't seem to work properly, but I think
> it's probably because it's so slow.  One thing I don't understand is that it
> will only work if I set flow control to software...it won't work on
> hardware.
>
> Now that I've explained what I'm trying to do, I was wondering if anyone can
> tell me how to make it work better--or tell me that there's no chance of
> getting it to work properly.  I've included the program I wrote.  It runs on
> the 486.
>
> -------------------MEMU.EX-----------------------
> --Modem emulator...fools computer on other end of serial cable, into
> thinking
> --it owns an external modem.
>
> --Anything that comes in com2 is sent out com1, and anything that comes in
> --com1 is sent out com2.
> --Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
> --Pressing any key breaks out of the program.
>
> without type_check
>
> include serial.e
>
> integer key,data,rcnt
> sequence rBuffer    rBuffer = {}
>
> clear_screen()
> puts(1,"Modem Emulator in operation...press a key to terminate...")
>
> SetPortBPDS(1,19200,0,8,1)  --Configure the ports
> SetPortBPDS(2,19200,0,8,1)
>
> rcnt = 0
> key = -1
> while key < 0 do
>     data = GetSerialByte(2)  --See if modem has sent any data
>     if data > 0 then
>         rBuffer &= data  --Yes, so put it in buffer
>         rcnt = 200   --This must be 200 in order not to lose data
>     else
>         rcnt = rcnt -1
>     end if
>     if rcnt < 1 then
>         rcnt = 0
>         key = get_key()   --If user has pressed a key, then exit prog
>         if length(rBuffer) > 0 then   --If there's anything in buffer,
>             for i = 1 to length(rBuffer) do --Send it out
>                 SendSerialByte(1,rBuffer[i]) --com1
>             end for
>             rBuffer = {}  --Empty the buffer
>         end if
>         data = GetSerialByte(1) --Get data from com1 (remote 'puter)
>         if data > 0 then    --If any data was waiting,
>             SendSerialByte(2,data) --send it to modem
>         end if
>     end if
> end while
> puts(1,"\n\nDone.\n")
> -------------------------------------------------
>
> Thanks in advance,
>
> Ben
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: External Modem Emulator

Although I cant suggest anything, I am much impressed by your solution. It
has always seemed to me, though, that a winmodem is not necessarily limited
to windows, but is little more thn a sound card hooked up to a phone line -
if you can get the correct commands to tell the winmodem to make sounds, and
get the specs for modem communications (what sounds do what), it should be
fairly easy. However, it seems noone has done that, so it must be fairly
hard. My congratulations, though on your novel solution - I wish I had a
spare 486 hanging around to do these sort of things with.

Nick
----- Original Message -----
From: Ben Logan <wbljr79 at HOTMAIL.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, January 27, 2000 11:56 AM
Subject: External Modem Emulator


> Thanks, Bernie, and Jeff.  I was able to get the com ports working.
>
> Here's what I'm trying to accomplish:
>
> I have two computers on the same desk; a P166 with a controller-less modem
> (winmodem--BLEHCK), and a 486 with a 14.4k modem.  I've recently installed
> Linux (Redhat 5.2) on the P166, and it won't work with the winmodem.  (I'm
> still running Windows on the P166, I'm just playing around with Linux.)
>
> So...I was thinking...what if I could redirect the input and output on the
> 486 so that anything coming in thru COM1 is sent out COM2, and anything
> coming in thru COM2 is sent out COM1.  Now, assuming that the modem in the
> 486 is on COM2, if I connect the two computers via a serial cable (COM1 on
> 486 to COM1 on P166) then the P166 will be fooled into thinking that it's
> got an external modem.  (I'm speculating, not stating fact.)
>
> So far, it seems to be working.  I can control the 486's modem from the
P166
> in Windows or Linux.  Some things don't seem to work properly, but I think
> it's probably because it's so slow.  One thing I don't understand is that
it
> will only work if I set flow control to software...it won't work on
> hardware.
>
> Now that I've explained what I'm trying to do, I was wondering if anyone
can
> tell me how to make it work better--or tell me that there's no chance of
> getting it to work properly.  I've included the program I wrote.  It runs
on
> the 486.
>
> -------------------MEMU.EX-----------------------
> --Modem emulator...fools computer on other end of serial cable, into
> thinking
> --it owns an external modem.
>
> --Anything that comes in com2 is sent out com1, and anything that comes in
> --com1 is sent out com2.
> --Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
> --Pressing any key breaks out of the program.
>
> without type_check
>
> include serial.e
>
> integer key,data,rcnt
> sequence rBuffer    rBuffer = {}
>
> clear_screen()
> puts(1,"Modem Emulator in operation...press a key to terminate...")
>
> SetPortBPDS(1,19200,0,8,1)  --Configure the ports
> SetPortBPDS(2,19200,0,8,1)
>
> rcnt = 0
> key = -1
> while key < 0 do
>     data = GetSerialByte(2)  --See if modem has sent any data
>     if data > 0 then
>         rBuffer &= data  --Yes, so put it in buffer
>         rcnt = 200   --This must be 200 in order not to lose data
>     else
>         rcnt = rcnt -1
>     end if
>     if rcnt < 1 then
>         rcnt = 0
>         key = get_key()   --If user has pressed a key, then exit prog
>         if length(rBuffer) > 0 then   --If there's anything in buffer,
>             for i = 1 to length(rBuffer) do --Send it out
>                 SendSerialByte(1,rBuffer[i]) --com1
>             end for
>             rBuffer = {}  --Empty the buffer
>         end if
>         data = GetSerialByte(1) --Get data from com1 (remote 'puter)
>         if data > 0 then    --If any data was waiting,
>             SendSerialByte(2,data) --send it to modem
>         end if
>     end if
> end while
> puts(1,"\n\nDone.\n")
> -------------------------------------------------
>
> Thanks in advance,
>
> Ben
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: External Modem Emulator

EU>Thanks, Bernie, and Jeff.  I was able to get the com ports working.

EU>Here's what I'm trying to accomplish:

EU>I have two computers on the same desk; a P166 with a controller-less modem
EU>(winmodem--BLEHCK), and a 486 with a 14.4k modem.  I've recently installed
EU>Linux (Redhat 5.2) on the P166, and it won't work with the winmodem.  (I'm
EU>still running Windows on the P166, I'm just playing around with Linux.)

EU>So...I was thinking...what if I could redirect the input and output on the
EU>486 so that anything coming in thru COM1 is sent out COM2, and anything
EU>coming in thru COM2 is sent out COM1.  Now, assuming that the modem in the
EU>486 is on COM2, if I connect the two computers via a serial cable (COM1 on
EU>486 to COM1 on P166) then the P166 will be fooled into thinking that it's
EU>got an external modem.  (I'm speculating, not stating fact.)

EU>So far, it seems to be working.  I can control the 486's modem from the P166
EU>in Windows or Linux.  Some things don't seem to work properly, but I think
EU>it's probably because it's so slow.  One thing I don't understand is that it
EU>will only work if I set flow control to software...it won't work on
EU>hardware.

EU>Now that I've explained what I'm trying to do, I was wondering if anyone can
EU>tell me how to make it work better--or tell me that there's no chance of
EU>getting it to work properly.  I've included the program I wrote.  It runs on
EU>the 486.

EU>-------------------MEMU.EX-----------------------
EU>--Modem emulator...fools computer on other end of serial cable, into
EU>thinking
EU>--it owns an external modem.

EU>--Anything that comes in com2 is sent out com1, and anything that comes in
EU>--com1 is sent out com2.
EU>--Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
EU>--Pressing any key breaks out of the program.

EU>without type_check

EU>include serial.e

EU>integer key,data,rcnt
EU>sequence rBuffer    rBuffer = {}

EU>clear_screen()
EU>puts(1,"Modem Emulator in operation...press a key to terminate...")

EU>SetPortBPDS(1,19200,0,8,1)  --Configure the ports
EU>SetPortBPDS(2,19200,0,8,1)

EU>rcnt = 0
EU>key = -1
EU>while key < 0 do
EU>    data = GetSerialByte(2)  --See if modem has sent any data
EU>    if data > 0 then
EU>        rBuffer &= data  --Yes, so put it in buffer
EU>        rcnt = 200   --This must be 200 in order not to lose data
EU>    else
EU>        rcnt = rcnt -1
EU>    end if
EU>    if rcnt < 1 then
EU>        rcnt = 0
EU>        key = get_key()   --If user has pressed a key, then exit prog
EU>        if length(rBuffer) > 0 then   --If there's anything in buffer,
EU>            for i = 1 to length(rBuffer) do --Send it out
EU>                SendSerialByte(1,rBuffer[i]) --com1
EU>            end for
EU>            rBuffer = {}  --Empty the buffer
EU>        end if
EU>        data = GetSerialByte(1) --Get data from com1 (remote 'puter)
EU>        if data > 0 then    --If any data was waiting,
EU>            SendSerialByte(2,data) --send it to modem
EU>        end if
EU>    end if
EU>end while
EU>puts(1,"\n\nDone.\n")
EU>-------------------------------------------------

EU>Thanks in advance,

EU>Ben

EU>______________________________________________________
EU>Get Your Private, Free Email at http://www.hotmail.com

Try writing as much in assembly as possible, so that it goes faster.
For example, try this:

push edx        ; Save the registers
push eax
mov dx, 765     ; COM2 data ready
in al, dx
and al, 1
cmp al, 0       ; Is data ready?
je noMoreData   ; No
mov dx, 760     ; COM2 input
in al, dx
mov dx, 1016    ; COM1 output
out dx, al
noMoreData:
pop eax         ; Restore registers and return
pop edx
ret

I haven't tested it, though.

Jeff

new topic     » goto parent     » topic index » view message » categorize

5. Re: External Modem Emulator

>to windows, but is little more thn a sound card hooked up to a phone line -
>if you can get the correct commands to tell the winmodem to make sounds,
>and
>get the specs for modem communications (what sounds do what), it should be
>fairly easy. However, it seems noone has done that, so it must be fairly

   Winmodem is a software emulated modem which uses a DSP ( Digital Signal
   Processor ) integrated circuit. The DSP can also emulate a soundcard
   with the proper software but it is not a simple task to write any
   emulator.

new topic     » goto parent     » topic index » view message » categorize

6. Re: External Modem Emulator

----- Original Message -----
From: Bernie Ryan <bwryan at PCOM.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, January 26, 2000 7:41 PM
Subject: Re: External Modem Emulator


> >to windows, but is little more thn a sound card hooked up to a phone
line -
> >if you can get the correct commands to tell the winmodem to make sounds,
> >and
> >get the specs for modem communications (what sounds do what), it should
be
> >fairly easy. However, it seems noone has done that, so it must be fairly
>
>    Winmodem is a software emulated modem which uses a DSP ( Digital Signal
>    Processor ) integrated circuit. The DSP can also emulate a soundcard
>    with the proper software but it is not a simple task to write any
>    emulator.

Plus, the emulation takes up (on my pc) more than 99% of the cpu's time.
That
means, while downloading a large file at any respectable baud rate, the
computer sometimes ignores less important things like mouse clicks,
keystrokes,
other programs....

Contrast that with an external (real) modem on the Linux box which ties up
almost
3% of the processor's cycles.

Irv

new topic     » goto parent     » topic index » view message » categorize

7. Re: External Modem Emulator

----- Original Message -----
From: timmy <tim781 at PACBELL.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, January 26, 2000 5:28 PM
Subject: Re: External Modem Emulator


> Hi This sounds like a fun project. I like electronics.
> I'm wanting to build a little electronic circuit that will
> automatically reboot my computer on every blue screen.
> Sometimes, hackers attack my computer when running my
> irc bots and I wake up the next morning to see that my computer
> crashed. So I thought, why not put a phototrasistor on a certain
> part of my monitor and whenever my computer crashes, the transistor
> recognizes the color and triggers my reset button on my computer.
> Well, I have'nt built it yet, but, I will sometime. :)

Wouldn't it be far more productive to just stay online? If you use a
firewall, the blue screen attacks are worthless to attackers.

Kat

new topic     » goto parent     » topic index » view message » categorize

8. Re: External Modem Emulator

HI Kat, My irc bot uses dcc which does'nt work
very good with firewalls. Socks4 is'nt allowed and
I don't know too much about socks5. Those are my only
choices with mIRC. :( ..timmy

Kat wrote:

> ----- Original Message -----
> From: timmy <tim781 at PACBELL.NET>
> To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
> Sent: Wednesday, January 26, 2000 5:28 PM
> Subject: Re: External Modem Emulator
>
> > Hi This sounds like a fun project. I like electronics.
> > I'm wanting to build a little electronic circuit that will
> > automatically reboot my computer on every blue screen.
> > Sometimes, hackers attack my computer when running my
> > irc bots and I wake up the next morning to see that my computer
> > crashed. So I thought, why not put a phototrasistor on a certain
> > part of my monitor and whenever my computer crashes, the transistor
> > recognizes the color and triggers my reset button on my computer.
> > Well, I have'nt built it yet, but, I will sometime. :)
>
> Wouldn't it be far more productive to just stay online? If you use a
> firewall, the blue screen attacks are worthless to attackers.
>
> Kat

new topic     » goto parent     » topic index » view message » categorize

9. Re: External Modem Emulator

I use mirc behind a firewall, with dcc, even dcc partylines and such. I even
do web browsing and http serving from mirc. Took several thousand nuke hits
one morning and stayed online. <shrug>

Kat


----- Original Message -----
From: timmy <tim781 at PACBELL.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, January 26, 2000 10:28 PM
Subject: Re: External Modem Emulator


> HI Kat, My irc bot uses dcc which does'nt work
> very good with firewalls. Socks4 is'nt allowed and
> I don't know too much about socks5. Those are my only
> choices with mIRC. :( ..timmy
>
> Kat wrote:
>
> > ----- Original Message -----
> > From: timmy <tim781 at PACBELL.NET>
> > To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
> > Sent: Wednesday, January 26, 2000 5:28 PM
> > Subject: Re: External Modem Emulator
> >
> > > Hi This sounds like a fun project. I like electronics.
> > > I'm wanting to build a little electronic circuit that will
> > > automatically reboot my computer on every blue screen.
> > > Sometimes, hackers attack my computer when running my
> > > irc bots and I wake up the next morning to see that my computer
> > > crashed. So I thought, why not put a phototrasistor on a certain
> > > part of my monitor and whenever my computer crashes, the transistor
> > > recognizes the color and triggers my reset button on my computer.
> > > Well, I have'nt built it yet, but, I will sometime. :)
> >
> > Wouldn't it be far more productive to just stay online? If you use a
> > firewall, the blue screen attacks are worthless to attackers.
> >
> > Kat
>

new topic     » goto parent     » topic index » view message » categorize

10. Re: External Modem Emulator

>From: JJProg at CYBERBURY.NET
>Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU>
>To: EUPHORIA at LISTSERV.MUOHIO.EDU
>Subject: Re: External Modem Emulator
>Date: Wed, 26 Jan 2000 19:00:46 EST
>
>EU>--Modem emulator...fools computer on other end of serial cable, into
>EU>thinking
>EU>--it owns an external modem.
>
>EU>--Anything that comes in com2 is sent out com1, and anything that comes
>in
>EU>--com1 is sent out com2.
>EU>--Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
>EU>--Pressing any key breaks out of the program.
>
>EU>without type_check
>
>EU>include serial.e
>
>EU>integer key,data,rcnt
>EU>sequence rBuffer    rBuffer = {}
>
>EU>clear_screen()
>EU>puts(1,"Modem Emulator in operation...press a key to terminate...")
>
>EU>SetPortBPDS(1,19200,0,8,1)  --Configure the ports
>EU>SetPortBPDS(2,19200,0,8,1)
>
>EU>rcnt = 0
>EU>key = -1
>EU>while key < 0 do
>EU>    data = GetSerialByte(2)  --See if modem has sent any data
>EU>    if data > 0 then
>EU>        rBuffer &= data  --Yes, so put it in buffer
>EU>        rcnt = 200   --This must be 200 in order not to lose data
>EU>    else
>EU>        rcnt = rcnt -1
>EU>    end if
>EU>    if rcnt < 1 then
>EU>        rcnt = 0
>EU>        key = get_key()   --If user has pressed a key, then exit prog
>EU>        if length(rBuffer) > 0 then   --If there's anything in buffer,
>EU>            for i = 1 to length(rBuffer) do --Send it out
>EU>                SendSerialByte(1,rBuffer[i]) --com1
>EU>            end for
>EU>            rBuffer = {}  --Empty the buffer
>EU>        end if
>EU>        data = GetSerialByte(1) --Get data from com1 (remote 'puter)
>EU>        if data > 0 then    --If any data was waiting,
>EU>            SendSerialByte(2,data) --send it to modem
>EU>        end if
>EU>    end if
>EU>end while
>EU>puts(1,"\n\nDone.\n")
>EU>-------------------------------------------------
>
>EU>Thanks in advance,
>
>EU>Ben
>
>EU>______________________________________________________
>EU>Get Your Private, Free Email at http://www.hotmail.com
>
>Try writing as much in assembly as possible, so that it goes faster.
>For example, try this:
>
>push edx        ; Save the registers
>push eax
>mov dx, 765     ; COM2 data ready
>in al, dx
>and al, 1
>cmp al, 0       ; Is data ready?
>je noMoreData   ; No
>mov dx, 760     ; COM2 input
>in al, dx
>mov dx, 1016    ; COM1 output
>out dx, al
>noMoreData:
>pop eax         ; Restore registers and return
>pop edx
>ret
>
>I haven't tested it, though.
>
>Jeff

Looks like it will work, but I'm not sure how to implement it in Euphoria.
In particular, how do I know what address to poke in for a label when I
don't know where it will be loaded into memory.  I looked at Pete's asm.e,
but will it resolve the addresses?

Also, do you think that the assembly language code will be fast enough, that
I can eliminate the buffer?  If not, how do I add a byte to the sequence
(rBuffer in the above code) from the asm routine?

Thanks again,

Ben
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

11. Re: External Modem Emulator

EU>>From: JJProg at CYBERBURY.NET
EU>>Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU>
EU>>To: EUPHORIA at LISTSERV.MUOHIO.EDU
EU>>Subject: Re: External Modem Emulator
EU>>Date: Wed, 26 Jan 2000 19:00:46 EST
EU>>
EU>>EU>--Modem emulator...fools computer on other end of serial cable, into
EU>>EU>thinking
EU>>EU>--it owns an external modem.
EU>>
EU>>EU>--Anything that comes in com2 is sent out com1, and anything that comes
EU>>in
EU>>EU>--com1 is sent out com2.
EU>>EU>--Some concepts are taken from E-TERM.EX--Thanks to PJB Systems
EU>>EU>--Pressing any key breaks out of the program.
EU>>
EU>>EU>without type_check
EU>>
EU>>EU>include serial.e
EU>>
EU>>EU>integer key,data,rcnt
EU>>EU>sequence rBuffer    rBuffer = {}
EU>>
EU>>EU>clear_screen()
EU>>EU>puts(1,"Modem Emulator in operation...press a key to terminate...")
EU>>
EU>>EU>SetPortBPDS(1,19200,0,8,1)  --Configure the ports
EU>>EU>SetPortBPDS(2,19200,0,8,1)
EU>>
EU>>EU>rcnt = 0
EU>>EU>key = -1
EU>>EU>while key < 0 do
EU>>EU>    data = GetSerialByte(2)  --See if modem has sent any data
EU>>EU>    if data > 0 then
EU>>EU>        rBuffer &= data  --Yes, so put it in buffer
EU>>EU>        rcnt = 200   --This must be 200 in order not to lose data
EU>>EU>    else
EU>>EU>        rcnt = rcnt -1
EU>>EU>    end if
EU>>EU>    if rcnt < 1 then
EU>>EU>        rcnt = 0
EU>>EU>        key = get_key()   --If user has pressed a key, then exit prog
EU>>EU>        if length(rBuffer) > 0 then   --If there's anything in buffer,
EU>>EU>            for i = 1 to length(rBuffer) do --Send it out
EU>>EU>                SendSerialByte(1,rBuffer[i]) --com1
EU>>EU>            end for
EU>>EU>            rBuffer = {}  --Empty the buffer
EU>>EU>        end if
EU>>EU>        data = GetSerialByte(1) --Get data from com1 (remote 'puter)
EU>>EU>        if data > 0 then    --If any data was waiting,
EU>>EU>            SendSerialByte(2,data) --send it to modem
EU>>EU>        end if
EU>>EU>    end if
EU>>EU>end while
EU>>EU>puts(1,"\n\nDone.\n")
EU>>
EU>>EU>Thanks in advance,
EU>>
EU>>EU>Ben
EU>>
EU>>EU>Get Your Private, Free Email at http://www.hotmail.com
EU>>
EU>>Try writing as much in assembly as possible, so that it goes faster.
EU>>For example, try this:
EU>>
EU>>push edx        ; Save the registers
EU>>push eax
EU>>mov dx, 765     ; COM2 data ready
EU>>in al, dx
EU>>and al, 1
EU>>cmp al, 0       ; Is data ready?
EU>>je noMoreData   ; No
EU>>mov dx, 760     ; COM2 input
EU>>in al, dx
EU>>mov dx, 1016    ; COM1 output
EU>>out dx, al
EU>>noMoreData:
EU>>pop eax         ; Restore registers and return
EU>>pop edx
EU>>ret
EU>>
EU>>I haven't tested it, though.
EU>>
EU>>Jeff

EU>Looks like it will work, but I'm not sure how to implement it in Euphoria.
EU>In particular, how do I know what address to poke in for a label when I
EU>don't know where it will be loaded into memory.  I looked at Pete's asm.e,
EU>but will it resolve the addresses?

EU>Also, do you think that the assembly language code will be fast enough, that
EU>I can eliminate the buffer?  If not, how do I add a byte to the sequence
EU>(rBuffer in the above code) from the asm routine?

EU>Thanks again,

EU>Ben
EU>______________________________________________________
EU>Get Your Private, Free Email at http://www.hotmail.com

Well, it's certainly a lot faster than Euphoria, and all the code is
inlined. I don't see much of an advantage to using a buffer since then
you might loose data while it is sending everything. I'm not sure how
you do labels with asm.e. You might want to inline some keyboard
routines in the assembly code so it goes even faster, then put it in a
loop so pretty much all of the program is in Assembly. You might take a
look at keyread.e. I'd write some more example code, but I really have
to work on some other stuff right now. I'll try writing some when I get
some time.

Jeff

new topic     » goto parent     » topic index » view message » categorize

12. Re: External Modem Emulator

On Wed, 26 Jan 2000 19:41:14 -0500, Bernie Ryan <bwryan at PCOM.NET> wrote:

>>to windows, but is little more thn a sound card hooked up to a phone line -
>>if you can get the correct commands to tell the winmodem to make sounds,
>>and
>>get the specs for modem communications (what sounds do what), it should be
>>fairly easy. However, it seems noone has done that, so it must be fairly
>
>   Winmodem is a software emulated modem which uses a DSP ( Digital Signal
>   Processor ) integrated circuit. The DSP can also emulate a soundcard
>   with the proper software but it is not a simple task to write any
>   emulator.

Just a note. Not all DSP containing modems would by definition be
WinModems. What makes something a WinModem is the extra driver
software required to make a Winmodem work. Part of the functionality of
a "hardware" internal, or external modem is taken over by software that
runs on the the main processor of the system. The DSP, when present,
actually offloads processing from the system. A DSP, for example, can
take the place of a serial port chip or several serial port chips on a
hardware board.

Everett L.(Rett) Williams
rett at gvtc.com

new topic     » goto parent     » topic index » view message » categorize

13. Re: External Modem Emulator

------=_NextPart_000_a604205_68baf10b$5cd55557

Thanks to everyone who helped me with my 'modem emulator'.

I re-wrote it in 100% assembler, and it seems to be working fine, although
I'll probably have to add some error checking.  I also did some reading, and
the reason I can't use hardware flow control, is that I'm using a null-modem
cable...the wires which would send/receive the signals are non-existant.
Now if I can figure out how to set Linux up for PPP... :)

For those who are interested, I've attached the asm file I wrote.

Regards,

Ben

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

------=_NextPart_000_a604205_68baf10b$5cd55557
Content-Transfer-Encoding: 8bit

new topic     » goto parent     » topic index » view message » categorize

14. Re: External Modem Emulator

On Fri, 28 Jan 2000 18:54:17 EST, Ben Logan <wbljr79 at HOTMAIL.COM> wrote:

>Thanks to everyone who helped me with my 'modem emulator'.
>
>I re-wrote it in 100% assembler, and it seems to be working fine, although
>I'll probably have to add some error checking.  I also did some reading,
and
>the reason I can't use hardware flow control, is that I'm using a null-
modem
>cable...the wires which would send/receive the signals are non-existant.
>Now if I can figure out how to set Linux up for PPP... :)


  Here is the wiring for a full null modem cable

  http://www.loop-back.com/null-mod.html

  If you want to operate at the highest baudrates you could use interrupt

  driven communications.

new topic     » goto parent     » topic index » view message » categorize

15. Re: External Modem Emulator

Had any luck with setting up PPP with linux?
If you have kde, it comes with KPPP, which will set everything up for you.
Otherwise, check your /usr/doc/howto directory for the ppp-howto.
I had a few problems setting up linux PPP using PPPD, but the main things to
remember are to:
    Enter your ISP's DNS server addresses in the /etc/resolv.conf file
    Un comment some bits and pieces in the ppp-on script (shouldnt be to
hard
    to see which bits)
If you need any help, dont hesitate to (call? email?)

Nick
----- Original Message -----
From: Ben Logan <wbljr79 at HOTMAIL.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, January 29, 2000 12:54 PM
Subject: Re: External Modem Emulator


> Thanks to everyone who helped me with my 'modem emulator'.
>
> I re-wrote it in 100% assembler, and it seems to be working fine, although
> I'll probably have to add some error checking.  I also did some reading,
and
> the reason I can't use hardware flow control, is that I'm using a
null-modem
> cable...the wires which would send/receive the signals are non-existant.
> Now if I can figure out how to set Linux up for PPP... :)
>
> For those who are interested, I've attached the asm file I wrote.
>
> Regards,
>
> Ben
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu