Jump to content
IGNORED

How hard would it be to reverse the E: and R: handlers?


Tyrop

Recommended Posts

I want to be able to redirect the Atari's input and output from the keyboard/screen to the RS232 so that I could operate the Atari remotely, i.e., use a modem or telnet into the Atari and be able to access DOS and Basic. Basically, the Atari would look to R1: for its input instead of the keyboard, and it would send its output to R1: instead of the screen. Would it be as simple as swapping the 'E' and the 'R' in the handler address table (HATABS)? I remember that IBM made it easy to redirect the standard input and output "stdin" and "stdout" via a simple DOS command. How complicated would it be to do this on the Atari?

Link to comment
Share on other sites

In BASIC, you can do it easily enough anyway.

 

You just need to Close #0 then re-open it.

 

But, BASIC doesn't let you do stuff with #0.

 

But... there is a trick:

 

just add 16 to the IOCB number.

 

So,

 

CLOSE #16:OPEN #16,12,0,"R:"

 

Problem is though - if anything causes a new "E:" device to open, it will revert to the default.

The alternative would be to just swap the letters in the HATABS region of memory.

 

 

Another alternative - just use the ENTER "<filespec>" command.

 

The input source doesn't have to contain a program, it can be any sequence of input strings.

Edited by Rybags
Link to comment
Share on other sites

I don't know about the Atari but I know the TRS-80 series have ROM vectors in RAM that point to the keyboard and print routines. By modding those pointers to your own routines you could do such a thing. If the Atari has an equivalent you could do the same.

Just remember, anything that bypasses those routines won't work. That usually means BASIC programs work but not all machine language programs.

Link to comment
Share on other sites

Wow, nice trick in Basic using OPEN #16,12,0,"R:"... I am using APE as an internet modem, and when I connect using WIndows Hyperterminal or telnet, I get the following repeated over and over again in Hyperterminal or in telnet:

 

ERROR- ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9

876543210/.-,+*)('&%$#"!

 

Any idea what this is? Even when I do ENTER "R:", the same error shows up repeated over and over, except on the Atari side (all in inverse except "ERROR-")

Link to comment
Share on other sites

As was stated before, I'd suspect you'd have problems due to ATASCII differences.

 

e.g. Atari "RETURN" = $9B (155 dec), just about everyone else = $0D (13)

 

Atari also ignores all of the control characters like LF, PF etc (ie anything less than 27) and just prints the graphics characters.

 

Read the doco - maybe there's something like "R2:" which does translation? Or maybe someone out there has already produced a handler which does.

Link to comment
Share on other sites

FWIW replacing device handlers on the Atari's is ridiculously easy. You can pretty much replace each function (command number) with anything you want. As long as you know a little bit assembly. It's just the translation between ASCII, ATASCII, and the internal keycodes may be a bit tricky.

Link to comment
Share on other sites

Wow, nice trick in Basic using OPEN #16,12,0,"R:"... I am using APE as an internet modem, and when I connect using WIndows Hyperterminal or telnet, I get the following repeated over and over again in Hyperterminal or in telnet:

 

ERROR- ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9

876543210/.-,+*)('&%$#"!

 

Any idea what this is? Even when I do ENTER "R:", the same error shows up repeated over and over, except on the Atari side (all in inverse except "ERROR-")

Depending on the device, for most R: devices you need to enter concurrent mode with some XIO command after the open if you want the atari to be able to receive characters IIRC.

Link to comment
Share on other sites

Kenfused was right... I needed to set concurrent mode on channel 16, so that fixed the repeated errors. Now, the Atari can only output. It does not seem to accept input from R1. I am using Atari Terminal Simulator (an ATASCII terminal program from the APE web page) on the PC side to connect, so I am transmitting carriage returns as 155, but the Aatari is not even echoing characters. THe following program outputs to R1, and its output on the Atari Terminal simulator shows HELLO, followed by the program listing, followed by the READY prompt, followed by the cursor. But after that, if I try typing on the Atari Terminal Simulator, I see nothing (although the APE Internet Proxy Monitor is flashes RX every time I type a character).

 

THank you all for responding to my post, I greatly appreciate all the helpful advice. I wrote a rudimentary BBS in the early 80's and I would like to try running it again, adding the ability to get into BASIC and DOS remotely.

 

Here is the short program:

10 CLOSE #16:OPEN#16,12,0,"R:"

20 XIO 40,#16,0,0,"R:" (sets concurrent mode I/O)

30 XIO 36,#16,15,0,"R:" (sets 9600 baud, 8 bits, 1 stop bit, no line monitoring)

40 XIO 38,#16,32,0,"R:" (no ASCII translation, ignore parity, do not change parity bit, do not append line feeds)

50 PRINT"HELLO"

60 LIST

 

That program outputs to R:, but does not accept input.

If anyone is willing to give this a shot with APE, you can set APE's R: internet modem in server mode, and telnet from the same computer running APE by putting in your PC's ip address. If you are behind a router, you can use your local ip address.

Link to comment
Share on other sites

  • 3 years later...

#13 means read & write with read from screen.

It causes the handler to not wait for "RETURN" to read a line.

It can be use to autorun basic programs for example also.

You print 'RUN "D:PETER.BAS", put the curso above the text and type.

OPEN #16,13,0,"E:"

 

From OS:

 

; AUX1 EQUATES

; () INDICATES WHICH DEVICES USE BIT

APPEND = $1 ;OPEN FOR WRITE APPEND (D), OR SCREEN READ (E)

DIRECT = $2 ;OPEN FOR DIRECTORY ACCESS (D)

OPNIN = $4 ;OPEN FOR INPUT (ALL DEVICES)

OPNOT = $8 ;OPEN FOR OUTPUT (ALL DEVICES)

OPNINO = OPNIN+OPNOT ;OPEN FOR INPUT AND OUTPUT (ALL DEVICES)

MXDMOD = $10 ;OPEN FOR MIXED MODE (E,S)

INSCLR = $20 ;OPEN WITHOUT CLEARING SCREEN (E,S)

Link to comment
Share on other sites

@jac

 

The program has a:

 

open #1,12,0,"R:"

 

This does not exist with the "R: Device (unless you have a MIO which does accept a 12 there)

 

with "R: it has to be a 13. So that line with the OPEN command has to be:

 

OPEN #1,13,0,"R:"

 

I'm working at the moment on a R: related program. It is working in BASIC and now I'm converting it to assembler. I was looking for some info on the forum, so I found this thread. The first thing what I thought reading was: why is that "12" there... I always had to use "13" on read/write with R: ... so that is why I answered.

 

It is an old thread, and the topic starter doesn't mind anyway I guess ;)

Link to comment
Share on other sites

  • 4 years later...

Yes, but better yet, make a SDX driver so it will work with all languages and programs, not just BXL. I may have to clean the rust off my SDX driver memory and attempt this thing, but, I'm afraid I'm severely lacking in skills after getting this far out of practice... :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...