Main Menu

KB#00104-Conversion: Converting From Other BASICs to BBx under Unix


Conversion: Converting From Other BASICs to BBx under Unix


Conversions From Other BASICs to BBx under Unix 

I. Be sure to back up your original programs and data before starting any conversions. 

II. To begin, physically move all the application programs and data files from the old Business BASIC machine to the machine with BBx. Use the BXSND/BXRCV conversion utilities to accomplish this. Detailed information on conversions is located in the BBxPROGRESSION/4 manual under Conversion Utilities. 

A) The CABLE: If the two machines have INCOMPATIBLE MEDIA, then you need to set up communications port-to-port. To do this, you must know the pin configurations for the ports you are going to connect in order to make the cable (or have it made by a third party such as Computerland). An alternative to knowing the pin configurations is to invest in a Smart Cable (by IQ TECHNOLOGIES) or an IntelliCable (by INMAC). Ninety-five percent of all cabling problems can be avoided by making this investment. Our most frustrated callers have a cabling error that we are unable to help them with. 

B) The PORTS: After your Smart Cable is hooked up to the two ports, communications must be set up. In order for both ports to be set up correctly, they must have: 

        The same baud rate 
        The same number of data bits 
        The same number of stop bits 
        The same parity (odd, even or none) 
        No echo 

Step-by-Step Conversion Example under the Unix Operating Systems: 

1. In this example, we will perform a conversion from a BASIC Four S10 machine to an IBM-RT with an AIX operating system at 9600 baud, 7 data bits, odd parity, and one stop bit. To set up the disabled RT port (in this case it's port /dev/tty1), we use the openport command. The "openport" works best under the Bourne shell. For example, 

# openport /dev/tty1 9600 cs7 parenb parodd -cstopb & <cr> 

Now, openport is running successfully in the background as process number 142, with communications for port /dev/tty1 on the IBM-RT set at 9600 and 7-o-1. 

2. The Unix operating system "stty" command can tell you what the current port settings are and can also change them for you after "openport" has been invoked on the disabled port. 

# stty -a < /dev/tty1 

Critical "stty" settings specific to machines running Unix operating systems are: 

-echo -inlcr -icrnl -igncr -opost ixon ixoff -ixany -xcase -icanon eof ^a eol ^a (or eof '^a' eol '^a' or min 1 time 0) which are for the port on the BBx side and most are automatically set by "openport". 

"stty" can also be used to change parameters if they are incorrect. 

For example, 

# stty eol '^a' < /dev/tty1 
# stty -echo ixon ixoff -ixany min 1 time 0 < /dev/tty1 

NOTE: If you are on an IBM RS6000 with AIX, use SMIT. "stty" is used for other Unix operating systems. 

Refer to your Unix operating system manuals for variations. 

3. Setting equivalent communications (9600, 7-o-1) on the S10 side through function and setup can be found in your BASIC Four S10 machine manual. 

[Note: See also the general port set up requirements (i.e., buffering, protocols, etc.) for both "sending" and "receiving" ports; found in the Conversion Chapter of the BBx Utilities Manual.] 

4. Now go into BBx and test communications by sending the appropriate LISTING program (located in the convert directory) over to the S10 and then save it under a new name "BXSND". For example, 

$ bbx4 

>10 open (1) "LISTING.S10" 
>20 open (2) "/dev/tty1" 
>30 read record(2,siz=1)A$ 
>40 read (1)A$ 
>50 print (2)A$ 
>60 goto 30 

On the S10 side: 

>SERIAL "TEMP" 1000,20,1,0 
>10 OPEN (1) "T1" 
>20 OPEN (2) "TEMP" 
>30 LOCK (2) 
>40 PRINT (1) "x", 
>50 READ (1) A$ 
>60 PRINT A$ 
>70 PRINT (2)A$ 
>80 GOTO 40 

At this point you should see the lines of code being sent by BBX on the IBM-RT. When they stop appearing, continue with the following on the S10 side: 

>OPEN (1) "temp" 
>MERGE (1) 
<Error 2 - End of File> 
>SAVE "BXSND",PSZ+512,1,0 

5. Now RUN "BXSND" 


6. On the BBx side continue with the following and RUN "BXRCV" 

>start 255 
>mkdir "progs" 
>run "BXRCV" 
INPUT FILE: /dev/tty1 
Toggle High Bits on all Data and Keys? (y/n): y 
progs/file1 .................. 
progs/file2 .................. 
progs/file3 .................. 

7. When the receive is complete, enter: 

>!vi progs/BXRCV.ERR 

to view the program lines listed that are incompatible with BBx and have been flagged with a "?". Note: BXRCV.ERR is re-created every time BXRCV is run, so it needs to be re-named for every batch of programs and data files that are brought over into the same directory. 

III. If the machines have COMPATIBLE MEDIA, then the first thing to do is bring up the old Business BASIC and run BXSND. You should allow about 64 pages for BXSND. BXSND will prompt you for the names of files. Enter one file name per line. Some versions of BXSND will allow an asterisk (*) at the end of the name to specify a directory scan. When you have finished inputting file names, just press <CR> at the FILE: prompt. 

Next, BXSND will ask you for the name of an output file. This will be the file that will be read by BXRCV. If you are sending many programs and data files at once, this file will need to be rather large since it must hold all of the information. Depending on the Business BASIC you are using, you might be asked for a disk number and possibly a file size. If you are running on a BASIC Four with BB3 or BB4, your output file must already exist as an indexed file with record size 128. BXSND will not attempt to create the file itself due to the inability of the BOSS operating system to simply define a file without concern for sector numbers. BXSND will output each file given while showing its progress on the screen. 

Once BXSND is finished, you should load BBx and run BXRCV. You should allow about 64 pages for BXRCV. BXRCV will prompt you for an input file. Enter the name of the file you created with BXSND. BXRCV will then tell you which Business BASIC it believes this file came from. Depending on the Business BASIC, BXRCV may ask you a few more questions. 

Finally, BXRCV will ask you for an output prefix. This prefix will be added at the front of the name of each file being received in order to cause creation of the files in any directory. In order to test the validity of the prefix, BXRCV will attempt to define a file called BXRCV.ERR using that prefix. If this fails then you should make sure the path indicated by the prefix exists and that unused floppy drives are DISABLEd. A null prefix is perfectly valid. BXRCV will scan program lines coming in from the input file and perform some automatic conversions. These conversions depend on which business basic the files came from. 

If, at this point, you feel that a conversion is too difficult to attempt, third-party references for Pertec, Rexon, Thoroughbred, B/4 and BP-99-Prime can be obtained from the BASIS Sales Services Department. 

Some Common Questions about Conversions 

Q When converting from a B4 system, the software contains packed dates (binary information). What would be the best way to handle the pack and unpack functions in BBx? 

A The best option is to convert the files inverting the high bit. This places the packed date data into High ASCII. Convert the programs with one additional conversion which is modify the pack and unpack functions to add 129 to the pack value and subtract 129 when unpacking. If the code is already converted, simply do a search and replace for the pack and unpack functions. Following this you will have to convert a few additional compares. For example, look for $010101$ compares and replace them with $818181$ compares. 

Q I'm requesting an explanation, or the best procedure reference, on rounding. An old B4 payroll was calculated at precision 4, then precision 2 was re-entered, and zero was added to the calculated number which correctly rounded the number. After conversion to BBx, this did not work the same and payroll was accumulating or losing pennies. We found a work around by multiplying by 1 rather than adding the 0. 

A There are no concrete rules for rounding on a B4. In the past, we have tried to determine the rules so we may be compatible, but were unable to come up with any rules that we could not find some strange exception to. Since B4 did not document rounding rules in their manual, we had to get as close as possible. Once we made up our rules, we documented them in our manual so BBx programmers no longer have to guess. While we regret that our rounding is not 100% the same as B4, it is now a moot point. Compatibility with ourselves is more important than compatibility with B4. 

Additionally, we do have a SETOPTS bit which, when set, will cause numeric rounding of intermediate results to occur. Refer to your BBx manuals for further information on SETOPTS.

SETOPTS may also be used to: 

Cause BBx to output a linefeed on a PRINT statement that has no IOLIST (some applications from other BASICS may depend on this) 

Cause embedded spaces to be stripped from the string argument to the NUM function, (some older BASICS do allow the embedded spaces) 

Cause BBx to reject WRITEs to a DIRECT or MKEYED file (in single key mode) or to an unEXTRACTed record when the WRITE doesn't specify a key (for compatibility with older BASICS) 



Last Modified: 09/11/2000 Product: PRO/5 Operating System: Unix

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel