RDROYA01@ULKYVX.BITNET (Robert Royar) (05/30/86)
WISH LIST:
Here are a few things I would like to see for CP/M-68K. Are they already
available?
A program to convert Z80 source to 68000 source.
Let's assume the source was originally written
for CP/M-80.
A program to convert 6500 source to 68000 source.
Perhaps to create an Apple-DOS emulator
debugger like that available for CP/M-80.
A program to convert 8088 source to 68000 source.
Mainly for CP/M-86 programs.
Would MS-DOS be that tough?
Ask ATARI!
A program which will decipher PC-DOS disks from within CP/M.
I can do this in CP/M-80 so it shouldn't be
that tough. PC-PIP does this with Osborne
computers under CP/M-80.
The name of a software supplier that knows what CP/M-68K is.HELLER%cs.umass.edu@CSNET-RELAY.ARPA.UUCP (06/02/86)
WISH LIST (Response):
- A program to convert Z80/6500/8086ish source to 68000
source.
Several problems: Converting assembly code for a
"primitive" machine to a not-so-"primitive" machine will
certianly result in silly code - take a sequence like:
(my 8080 assembly is VERY rusty. i probably have to wrong
opcodes, etc.)
* multiply HL by 10(decimal):
mov l,a * move l to a
clc * clear carry bit
rlc a * rotate a left through the carry
mov a,l * stash l back
mov h,a * get h to a
rlc a * rotate a left through the carry
mov a,h * stash h back
mov l,e * copy hl to de
mov h,d * both bytes
mvi 2,b * loop counter
l1: mov l,a * move l to a
clc * clear carry bit
rlc a * rotate a left through the carry
mov a,l * stash l back
mov h,a * get h to a
rlc a * rotate a left through the carry
mov a,h * stash h back
dcr b
jnz l1
dad d * add x2 to x8
This sequence could be replaced by
mulu #10,D0
but a translated program wouldn't know to do this. It is
probably best to only try to port high level language code
(ie C, Pascal, FORTRAN, BASIC, etc.) rather then translate
assembly code. If you must port an assembly language you
can almost to better to re-write it rather than machine
translate it. There is a PD 8080/CP/M-2.2 emulator
available. Slow, (10Mhz 68000 === 2Mhz Z80) but works.
- A program which will decipher PC-DOS disks from within CP/M.
I wrote a program in C to read IBM-PC disks on my Stride
(also works on Sages) under CP/M-68K. It alters the disk
configuration (48 TPI vs. 96 TPI, 8 sector/track). and does
"low level" I/O (below even CP/M BIOS), but that can be
easily re-hacked to do regular CP/M-68K BIOS calls. All of
the real MS-DOS file struture hackery is there in any case.
It is written in C (DRI's) and is now up on SIMTEL20
(PD:<CPM.CPM68K>UTILS.LBR.1 - CONFIG.HQ, IBMREAD.CQ,
IBMREAD.MQN, IBMREAD.6QK). I can send you unsquesed
sources via electronic mail - it is not very long - let me
know. The program is not super clever - it will read ALL
of the MS-DOS files in either text or binary modes. It
does not support writing MS-DOS file format. My drives are
96TPI - while it is posible in theory to write 48TPI on
96TPI, it is not reliable and can only be done on virgin or
bulk erased disks (it is in fact done by writing 1/2 width
tracks - need a good 48TPI drive to read it without
errors!). I only wrote this program to do one-way file
transfer (8" CP/M SSSD format => VAX/VMS => IBM-PC => Sage
(later Stride)). I don't use it now - I transfer files
using a DEC Rainbow (has 96TPI drives).
Another thing about software for CP/M-68K: check out UNIX.Sources.
Many UNIX C programs will compile and run under CP/M-68K, with little
or no modifications. Mostly you need to check to function results
(you really need those char *calloc() and FILE *fopen() decls. and
int is not long int). Also old-fashined C-isms: =+ instead of +=.
Also, various system services don't exist and file names may need to
be hacked. Most of this sort of stuff can be handled with #defines
and or #if[n]defs. I have converted several UNIX programs without
too much trouble.
Robert Heller
Heller@UMass-CS.CSNET