Dec 132017
 
Tranfer files from IBM to an Amiga by cables. (Instructions).
File IBM-AMI.ZIP from The Programmer’s Corner in
Category Tutorials + Patches
Tranfer files from IBM to an Amiga by cables. (Instructions).
File Name File Size Zip Size Zip Type
IBM-AMI.DOC 8531 2950 deflated

Download File IBM-AMI.ZIP Here

Contents of the IBM-AMI.DOC file


Subject: Amiga <-> IBM transfers (A fast System)

Say ALL you amiga developers using PC's as a cross system. Tired of
waiting around for your 9600 baud transfers to complete. Well here's
a quick and dirty set of programs that will send files from the PC
to the AMIGA over the parallel interface. First build a cable like
this:

DB25 Male DB25 Female
PC AMIGA
--------- -----------
-STROBE 1 ......... 13 SEL
D0 2 ......... 2 D0
D1 3 ......... 3 D1
D2 4 ......... 4 D2
D3 5 ......... 5 D3
D4 6 ......... 6 D4
D5 7 ......... 7 D5
D6 8 ......... 8 D6
D7 9 ......... 9 D7
-ACK 10 ......... 11 BUSY
-SLCT IN 17 ......... 12 POUT
GND 18 ......... 18 GND
GND 19 ......... 19 GND
GND 20 ......... 20 GND
GND 21 ......... 21 GND
GND 22 ......... 22 GND
GND 23 ......... 14 GND
GND 24 ......... 15 GND
GND 25 ......... 16 GND

* YOU DON'T REALLY NEED MORE THAN ONE GROUND BUT HOOK UP AS MANY AS POSSIBLE

Then Compile TOA.C on the IBM (Microsoft C) and FIBM.C on the Amiga,
and hook 'em up.

To Transfer:
IBM: C> TOA FILENAME

AMIGA:
1> FIBM

* THE ORDER OF THESE COMMANDS DOES NOT MATTER ONE WILL ALWAYS WAIT FOR THE
OTHER

FIBM has no options.
These are the options for TOA:
-b Send following files binary (no translations)
-a Send following files ascii (\n\r to \n, strip ^Z)
-d Add to the begining of the file name.
Useful as -dRAM: to send straight to the ram disk
-p{0|1} Select Printer Port 0 or 1 (not tested)
-h Hang on. Don't send EOT to amiga. Useful if you want
to send several batches of files

The MicroEmacs binary took 198 seconds with 9600 baud RS232.
With the parallel connection it took 13 seconds. Also you can transfer
to disk directly instead of going through the RAM disk.
TOA can send as many files as you can fit on a command line. FIBM will
wait for an end of transmission character before exiting.

This is Public Domain you can do anything you wan't with it as long as you
don't get any bucks for it.

This thing really eats up the CPU time. I would try running it in
the background (the price you pay for speed).


-------------------------------TOA.C (for IBM)-------------------------------
/*

TOA - Transfer files to an Amiga via Parallel connection

Edit History:
R. Max Mutrux 21-DEC-85 V1.0 Gee It Works(?)

*/
#include
#include

char aton[32]; /* Device Added to name before opening (Remote) */
char sname[64]; /* final transmitted name */
int f_binary = 1; /* binary flag */
int f_hold = 0; /* hold flag */
int devbase = 0x278;/* Parallel Printer Port */

int reg_data = 0x278;
int reg_ctrl = 0x27a;
int reg_status = 0x279;
main(ac,av)
int ac;
char *av[];
{
int i;
int j;
char *fstrip();

if(ac<2) {
printf("Usage: toa [-{b|a}] [-ddevice] [-p{0|1}] [-h] file [file...]\n");
exit(1);
}
aton[0] = 0;
for(i=1; i if(av[i][0]=='-') {
switch(av[i][1]) {
case 'b': case 'B': /* Binary */
f_binary = 1;
continue;
case 'a': case 'A': /* Ascii */
f_binary = 0;
continue;
case 'd': case 'D': /* Device (Destination) */
strcpy(aton,&av[i][2]);
continue;
case 'p': case 'P':
if(av[i][2]=='2')
devbase = 0x378;
else
devbase = 0x278;
reg_data = devbase;
reg_ctrl = devbase+2;
reg_status = devbase+1;
continue;
case 'h': case 'H':
f_hold = 1;
continue;
default:
printf("-%c Huh?\n",av[i][1]);
}
}
if(f_binary)
j = open(av[i],O_RDONLY|O_BINARY);
else
j = open(av[i],O_RDONLY|O_TEXT);
sprintf(sname,"%s%s",aton,fstrip(av[i]));
if(j>0) {
printf("SEND: \"%s\" as \"%s\" ",av[i],sname);
transmit(j,sname);
close(j);
printf("Done\n");
}
}
if(f_hold==0)
sendbyte(0x1ff);/* send end of transmition special char */
}

char *fstrip(s)
register char *s;
{
register int l;
l = strlen(s) - 1;
for(;l>=0;--l) {
if(s[l]==':' || s[l]=='\\' || s[l]=='/')
break;
}
return &s[l+1];
}

transmit(fd,na)
int fd;
char *na;
{
char block[512];
int l;
sendbyte(0x100); /* send start of name special char */
sendblock(na,strlen(na));
sendbyte(0x101); /* send start of data special char */
while((l=read(fd,block,512))!=0)
sendblock(block,l);
sendbyte(0x1fe); /* send end of data special char */
}

sendblock(b,l)
register unsigned char *b;
register int l;
{
while(--l >=0 )
sendbyte(*b++);
}

sendbyte(c)
register int c;
{
register i7a;
i7a = 0;
outp(reg_data,c&255); /* assert byte onto data pins */
if(c>255)
i7a = 8; /* if special char (C)*/
else
i7a = 0; /* if data char (D)*/
outp(reg_ctrl,1|i7a); /* assert DAV and C/D */
while(inp(reg_status)&0x40) ; /* wait for ACK asserted*/
outp(reg_ctrl,0); /* negate DAV and C/D */
while((inp(reg_status)&0x40)==0); /* wait for ACK negated */
}

-----------------------------FIBM.C (for Amiga)------------------------------
/*

FIBM - Receive files from an IBM via Parallel connection

Edit History:
R. Max Mutrux 21-DEC-85 V1.0 Boy this Amiga is slick

*/
#include

#define STATE_NULL 0 /* THROW OUT DATA */
#define STATE_NAME 1 /* RECEIVE NAME */
#define STATE_DATA 2 /* RECEIVE DATA */

main()
{
register unsigned char *dataport;
register unsigned char *ctrlport;
unsigned char *datadirport;
unsigned char *ctrldirport;
unsigned char origdatadir;
unsigned char origctrldir;
register unsigned int c;
register unsigned int state;
register unsigned int block_len;
register unsigned long filep;
register int i;
char block[512];
dataport = (char *)0xbfe101;
datadirport = (char *)0xbfe301;

ctrlport = (char *)0xbfd000;
ctrldirport = (char *)0xbfd200;

origdatadir = *datadirport;
origctrldir = *ctrldirport;
*datadirport = 0x00;
*ctrldirport |= 0x01;

state = 0;
filep = 0;
block_len = 0;

for(;;) {
while((*ctrlport&0x04)) ;
c = *ctrlport & 0x02;
if(!c)
c = 0x100;
else
c = 0;
c |= *dataport;
*ctrlport &= ~1;
while((*ctrlport&0x04)==0) ;
*ctrlport |= 1;
if(c<0x100) {
if(state==STATE_NAME) {
if(block_len>30)
continue;
block[block_len++] = c;
} else {
if(state==STATE_DATA) {
if(block_len>511) {
if(Write(filep,block,block_len)<0) {
printf("write error %d\n",IoErr());
Close(filep);
state = STATE_NULL;
}
block_len = 0;
}
block[block_len++] = c;
}
}
} else {
switch(c-0x100) {
case 0x00: /* START OF FILE NAME */
block_len = 0;
state = STATE_NAME;
continue;
case 0x01: /* START OF DATA FOR FILE */
block[block_len++] = 0;
block_len = 0;
printf("REC: \"%s\" ",block);
filep = Open(block,1006);
if(filep==0L) {
i = IoErr();
printf("open error %d\n",i);
state = STATE_NULL;
continue;
}
state = STATE_DATA;
continue;
case 0xfe: /* END OF FILE */
if(state==STATE_DATA) {
if(block_len>0) {
if(Write(filep,block,block_len)<0)
printf("Write Error %d\n",IoErr());
else
printf("OK\n");
} else
printf("OK\n");
Close(filep);
}
state = STATE_NULL;
continue;
case 0xff: /* END OF TRANSMITTION */
printf("EOT\n");
exit(1);
}
}
}
}



 December 13, 2017  Add comments

Leave a Reply