Aztec-C and transferring files from Windows XP to a CPM disk - CP/M

This is a discussion on Aztec-C and transferring files from Windows XP to a CPM disk - CP/M ; No answers in this message, just questions and comments... To begin with I am in the process of preparing a complete Aztec-C build environment for CP/M-86 for my Aztec-C Museum Website. This is all working pretty well and is for ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Aztec-C and transferring files from Windows XP to a CPM disk

  1. Aztec-C and transferring files from Windows XP to a CPM disk

    No answers in this message, just questions and comments...

    To begin with I am in the process of preparing a complete Aztec-C
    build environment for CP/M-86 for my Aztec-C Museum Website.

    This is all working pretty well and is for the most part finished.
    However I am a little puzzled because for the other distributions that
    I have prepared for the Commodore 64 and the Apple IIe I have been
    able to find a multitude of emulators.

    When I got into CP/M-80 the field narrowed somewhat and I used Simeon
    Cran's MYZ80. CP/M-86 got narrower yet.

    Now taking the view that not all emulators are created to solve the
    same problem and each has its own POV (like amiga emulators that can't
    give you the Quickstart ROMs because of copyright issues with CBM) and
    DOSBox which uses the native file system but still provides a complete
    session I have kept an open mind and used the only emulator that I can
    find for CP/M-86 (CPM.EXE Copyright (c) 1985-1997 Jim Lopushinsky)
    which doesn't provide a session (it executes on a CMD x CMD basis and
    works (for the most part) on Aztec C programs
    except on most DISK/IO which may be on all CP/M-86 programs in XP
    since Aztec C uses bdos int 224 for all DISK/IO and doesn't do any
    funky bios stuff.)

    Taking things one step further I also cut myself a CP/M-86 1.44
    diskette using copyqm which I used back when I was a cowboy cutting
    code for MS-DOS and while it boots my 64 bit 3000 mghz AMD into CP/
    M-86 beautifully I have hit a stumbling block. I cannot identify the
    disk format that has been used for this with the many tools that I
    have tried and even if I could what guarantee do I have that I can
    transfer files to and from this diskette... the utilities that I have
    located may or may not work if I can identify the disk format.

    Since the only CP/M-86 emulator that I have found doesn't use a
    diskimage there isn't the same level of utilities as on other legacy
    platforms....

    Where to go from here? Well I thought I'd better ask-around. In a
    perfect world the CPM emulator that I have would work with DISK/IO
    under XP and I could also edit diskimages directly and add Aztec-C
    CMD's to them so folks that downloaded this compiler could actually
    work in native mode CPM with programs that they built under native
    mode XP.

    Bill

    http://www.clipshop.ca/Aztec/index.htm
    http://en.wikipedia.org/wiki/User:Bill_Buckels

  2. Re: Aztec-C and transferring files from Windows XP to a CPM disk

    On Mar 23, 9:25*am, Bill Buckels wrote:

    > (CPM.EXE Copyright (c) 1985-1997
    > Jim Lopushinsky) which doesn't provide a session (it executes on a
    > CMD x CMD basis and works (for the most part) on Aztec C programs
    > except on DISK/IO


    The following does in fact work fine in Windows XP using raw IO (not
    buffered) and Jim Lopushinsky's CP/M-86 emulator. However I would
    love it if someone has a utility to transfer this program and others
    like it to a bootable CP/M-86 diskimage that can be cut and booted on
    an XP box. I don't really want to put the effort into writing such a
    thing and I certainly don't want to put-up a linux VM for something
    this simple.

    x--- snip ---x

    # -------------------------------------------------------------
    # makefile(C) Copyright Bill Buckels 2008. All rights reserved.
    #
    # This makefile uses a separate compiler and assembler pass
    # to generate an object (.o) file.
    # It then links to the CP/M-86 library to produce a CPM .CMD
    # and also links to the DOS 2.0 library to produce a .COM
    # I had problems using the original commands that came with
    # the Aztec C CP/M-86 version 3.2d using the CPM86 emulator
    # So I replaced them with the equivalent commands from
    # the Aztec C C-86 version 3.4b to provide a Windows XP
    # build environment for creating CP/M-86 .CMD programs.
    # By creating a DOS 2.0 .COM as well as a CPM .CMD I wanted
    # to provide the option of testing the program under the
    # XP cmd window with and without the CPM86.EXE emulator.
    # -------------------------------------------------------------
    PRG=bpic
    $(PRG).com: $(PRG).o
    ln -o $(PRG).cmd $(PRG).o g.lib c.lib
    ln -o $(PRG).com $(PRG).o g.lib d20.lib
    del $(PRG).o
    @echo All Done!

    $(PRG).o: $(PRG).c
    cc -A $(PRG).c
    as $(PRG).asm
    del $(PRG).asm

    x--- snip ---x


    /* bpic.c (C) Copyright 2008 Bill Buckels. All rights reserved. */

    /* A BASIC BSaved graphics image loader for
    DOS 2.0 or CP/M-86

    Written in Aztec C86 v3X

    Handles CGA 320 x 200 x 4-Color or 640 x 200 x 2 Color screens.

    For more info on these See my Wikipedia Article at:

    http://en.wikipedia.org/wiki/BSAVE_(...s_image_format)

    For a program to create these in Windows XP from a variety of
    sources download a copy of my ClipShop program at:

    www.clipshop.ca

    */

    #include

    /* one of my headers */
    #include

    /* no need to load the entire image
    just load the 192 bytes between the interleaves
    to simplify for a contiguous load */

    #define SCREENSIZE 16192
    #define SCREENSEG 0xb800

    /* a read buffer */
    char databuf[SCREENSIZE];

    /* a microsoft compatible bsaved image format descriptor */
    char bsave_header[7]=
    {'\xfd','\x00','\xb8','\x00','\x00','\x00','\x40'} ;

    /* for verification... check the first 5 bytes only!

    the marker byte 0xfd is followed by 3 intel 16 bit integers
    giving originating segment, offset, and filelength of the image.

    The filelength can vary here but the first 5 bytes are
    pretty mich invariant. As far as length most of these were 0x4000
    (16384) bytes not including the 7 byte header and BASIC's
    ubiquituous [CTRL]-Z (0x1a) footer (which was reminiscent of the
    early x86 file systems but wasn't always present at the end of these
    either depending on who and how).

    The reason that most of us saved them that way was probably because
    of the example in the GWBASIC manual... and IBM PC StoryBoard's
    PictureMaker (PM.EXE) v1 saved them that way as well... perhaps they
    read the same manual.

    But John Bridges saved these in PicEM the same way I am loading them
    here... without the padding on the end. (John didn't code in BASIC
    even in those days), and Eugene Ying who did saved them as 16512
    bytes in PCPG which doesn't make much sense to me.

    That was a long time ago anyway.

    */

    /* K & R style function body */
    main(argc, argv)
    int argc;
    char **argv;
    {

    int fh, idx, status, vmode = 'M';
    union REGS inregs, outregs;
    struct SREGS sregs;

    if (argc < 2) {
    printf("Usage: bpic [my.bas] [options 'H' for hires or 'M' for medres]
    \n");
    exit(1);

    }

    /* check for video mode */
    if (argc > 2) {
    if (argv[2][0] == '-')idx =1;
    else idx = 0;
    if (argv[2][idx] == 'h' || argv[2][idx] == 'H')vmode = 'H';

    }

    sysint(0x11,&inregs,&outregs); /* get equipment list from the bios */

    /* get display type (bits 4 and 5 of ax) */
    if (!((outregs.x.ax & 0x30) < 0x30)) {
    printf("CGA compatible displays only! Exiting.\n");
    exit(1);
    }


    fh = open(argv[1],O_RDONLY);


    if (fh == -1) {
    printf("Unable to open %s!\n",argv[1]);
    exit(1);
    }

    read(fh,databuf,7);
    for (idx = 0; idx < 5; idx++) {
    if(databuf[idx]!= bsave_header[idx]) {
    close(fh);
    printf("Unsupported Format!\n");
    exit(1);
    }

    }

    /* we are in small memory model so need to get the segment
    that we are running-in to move image data direct
    to the CGA screen address... */
    segread(&sregs);

    read(fh,&databuf[0],SCREENSIZE);
    close(fh);

    mode(vmode);

    /* note that I am using the ds register value with
    the datasegment address of my near pointer
    for my image data buffer as the base address for
    the source of my memory block move... */
    movblock(&databuf[0],sregs.ds,0,SCREENSEG,SCREENSIZE);

    /* wait for a key press */
    /* use sysint to generate int 16h */

    inregs.x.ax = 0x0000;
    inregs.x.dx = 0x0000;
    sysint(0x16,&inregs,&outregs);
    /* return the low order char */
    status = outregs.x.ax&0x00ff;

    mode('L');

    exit(status);


    }

  3. Re: Aztec-C and transferring files from Windows XP to a CPM disk

    On Mar 23, 9:25*am, Bill Buckels wrote:
    > No answers in this message, just questions and comments...
    >
    > To begin with I am in the process of preparing a complete Aztec-C
    > build environment for CP/M-86 for my Aztec-C Museum Website.
    >

    Great Idea!

    > This is all working pretty well and is for the most part finished.
    > However I am a little puzzled because for the other distributions that
    > I have prepared for the Commodore 64 and the Apple IIe I have been
    > able to find a multitude of emulators.
    >
    > When I got into CP/M-80 the field narrowed somewhat and I used Simeon
    > Cran's MYZ80. CP/M-86 got narrower yet.
    >
    > Now taking the view that not all emulators are created to solve the
    > same problem and each has its own POV (like amiga emulators that can't
    > give you the Quickstart ROMs because of copyright issues with CBM) and
    > DOSBox which uses the native file system but still provides a complete
    > session I have kept an open mind and used the only emulator that I can
    > find for CP/M-86 (CPM.EXE Copyright (c) 1985-1997 Jim Lopushinsky)
    > which doesn't provide a session (it executes on a CMD x CMD basis and
    > works (for the most part) on Aztec C programs
    > except on most DISK/IO which may be on all CP/M-86 programs in XP
    > since Aztec C uses bdos int 224 for all DISK/IO and doesn't do any
    > funky bios stuff.)
    >


    All the standard tools [asm86.cmd, gencmd.cmd, etc.] work fine on
    CPM.EXE, but under XP the FCB's in autoexec.nt or config.nt might need
    to be increased, google this group for the details on CPM.EXE,
    perhaps this is the hitch for Aztec C.

    > Taking things one step further I also cut myself a CP/M-86 1.44
    > diskette using copyqm which I used back when I was a cowboy cutting
    > code for MS-DOS and while it boots my 64 bit 3000 mghz AMD into CP/


    I presume this is CP/M-86 with the 144FEAT2 driver version. The
    straight CP/M-86 for the IBM PC, PC/XT, original can only be used
    reliably on a 720k, 3 1/2, diskette formatted as a 360k diskette.

    > M-86 beautifully I have hit a stumbling block. I cannot identify the
    > disk format that has been used for this with the many tools that I
    > have tried and even if I could what guarantee do I have that I can
    > transfer files to and from this diskette... the utilities that I have
    > located may or may not work if I can identify the disk format.
    >

    Also google this group for 22DISK for tranfer of files to/from pcDos
    from/to CP/M-86 diskette under pcDos..
    There is a disk definition specific to the 144FEAT, 3 1/2, 1.44
    diskette form.
    Also google this group for FEAT.

    > Since the only CP/M-86 emulator that I have found doesn't use a
    > diskimage there isn't the same level of utilities as on other legacy
    > platforms....
    >


    CP/M-86 for the IBM PC, v1.1, read all the tracks on side0 before
    reading all the tracks on side1, and the track order on side1 was
    inverted, so the physical r/w was:
    Trk_0 outer track to inner track, Trk_1 inner track to outer, 8spt.

    > Where to go from here? Well I thought I'd better ask-around. In a
    > perfect world the CPM emulator that I have would work with DISK/IO
    > under XP and I could also edit diskimages directly and add Aztec-C
    > CMD's to them so folks that downloaded this compiler could actually
    > work in native mode CPM with programs that they built under native
    > mode XP.
    >
    > Bill
    >
    > http://www.clipshop.ca/Aztec/index.h...r:Bill_Buckels


    Steve

  4. Re: Aztec-C and transferring files from Windows XP to a CPM disk

    Bill Buckels wrote:
    > No answers in this message, just questions and comments...


    > Since the only CP/M-86 emulator that I have found doesn't use a
    > diskimage there isn't the same level of utilities as on other legacy
    > platforms....


    Have you looked at bochs?


    ----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.pronews.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= - Total Privacy via Encryption =---

  5. Re: Aztec-C and transferring files from Windows XP to a CPM disk

    On Mar 24, 12:48*pm, s_dubrov...@yahoo.com wrote:

    >
    > All the standard tools [asm86.cmd, gencmd.cmd, etc.] work fine on
    > CPM.EXE, but under XP the FCB's in autoexec.nt or config.nt might need
    > to be increased, *google this group for the details on CPM.EXE,
    > perhaps this is the hitch for Aztec C.
    >


    I did this before even trying CPM.EXE but may have set the FCBS too
    low or some other issue.

    However I got a tip from another gentleman and tried AME86 and it
    works flawlessly even allowing me to create and run CP/M 86 overlay
    programs written in Aztec-C.

    The site where I downloaded AME86 had a confusing comment which
    originally led me to believe that it would only work on an old DEC,
    but XP seems to like it better than this other. I may revisit CPM.EXE
    but for right now I would be recommending AME86 on my Aztec-C website
    and to whoever else might ask.

    Thanks for the replies and suggestions.

    Bill

  6. Re: Aztec-C and transferring files from Windows XP to a CPM disk

    On Mar 26, 8:22*am, Bill Buckels wrote:
    > On Mar 24, 12:48*pm, s_dubrov...@yahoo.com wrote:
    >
    >
    >
    > > All the standard tools [asm86.cmd, gencmd.cmd, etc.] work fine on
    > > CPM.EXE, but under XP the FCB's in autoexec.nt or config.nt might need
    > > to be increased, *google this group for the details on CPM.EXE,
    > > perhaps this is the hitch for Aztec C.

    >
    > I did this before even trying CPM.EXE but may have set the FCBS too
    > low or some other issue.
    >
    > However I got a tip from another gentleman and tried AME86 and it
    > works flawlessly even allowing me to create and run CP/M 86 overlay
    > programs written in Aztec-C.
    >
    > The site where I downloaded AME86 had a confusing comment which
    > originally led me to believe that it would only work on an old DEC,
    > but XP seems to like it better than this other. I may revisit CPM.EXE
    > but for right now I would be recommending AME86 on my Aztec-C website
    > and to whoever else might ask.
    >
    > Thanks for the replies and suggestions.
    >
    > Bill


    I think the DEC reference means the DEC Rainbow. I think it was a
    dual processor system, z80, 8088.

    I don't know if you know about:
    http://www.retroarchive.org/cpm/lang/lang.htm
    Which has a cp/m-86 version of Aztec-C, v 3.02, also the manual is
    there.
    I guess that manual is close to the version you recommend for cp/m-86.

    hth.

    Steve

+ Reply to Thread