Image Map Image Map
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: CP/M compatible cross assembler?

  1. #1
    Join Date
    Dec 2011
    Location
    Dallas, TX
    Posts
    245

    Default CP/M compatible cross assembler?

    Does anyone know of a cross assembler for the 8080 that can compile CP/M format assembly files? I am trying to compile various Personality Module images for the SOL-20 from CP/M assembly source. It would be nice to have a Makefile that can run under MacOS/Unix/Linux/Windows without having to invoke a CP/M emulator.

    Dave

  2. #2
    Join Date
    Jan 2010
    Location
    Central VA
    Posts
    4,663

    Default

    William Colley III's A85 is the closest I've found, Herb has a version with modifications to get it building under modern C compilers:

    http://www.retrotechnology.com/restore/a85.html

    I'm currently using that for most of my development. I've done a little customizing to it, I need to get it documented and up somewhere for download.

  3. #3
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    32,467
    Blog Entries
    18

    Default

    Why not use an emulator running a native CP/M assembler. e.g. This one was run on a 64 bit Linux host:

    Code:
    011B
    000H USE FACTOR
    END OF ASSEMBLY
    
     0100                   ORG     100H
    
     0005 =         BDOS    EQU     0005H                   ; LOCATION OF BDOS ENTRY POINT
     0000 =         BOOT    EQU     0000H                   ; LOCATION OF BOOT REQUEST
    
                    START:
     0100 0E09              MVI     C,9                     ; BDOS REQUEST 9 - PRINT STRING
     0102 110B01            LXI     D,MESSAGE               ; OUR STRING TO PRINT
     0105 CD0500            CALL    BDOS
     0108 C30000            JMP     BOOT                    ; EXIT TO CP/M
    
                    MESSAGE:
     010B 0D0A48454C        DB      13,10,'HELLO WORLD',13,10,'$'
    
     011B                   END     START

  4. #4

    Default

    I worked with George on a "-dri" option to ZMAC (http://48k.ca/zmac.html) which allowed me to compile a lot of DRI source code.
    - Doug

  5. #5
    Join Date
    Dec 2011
    Location
    Dallas, TX
    Posts
    245

    Default

    Quote Originally Posted by Chuck(G) View Post
    Why not use an emulator running a native CP/M assembler. e.g. This one was run on a 64 bit Linux host:
    That's what I'm doing now, and it works. However, putting that in a makefile would require a lot more prerequisites and a lot more complexity to do a build compared with requiring a single assembler. For each source file, the file would need to be copied into a disk image and a script added or modified in the image to assemble the file, then the emulator would have to be run on the image, then the result would have to be extracted. The reason to not just do the whole ROM image build under CP/M is to be able to have source on github and be able to build easily from that source without lots of extra steps.

  6. #6
    Join Date
    Dec 2011
    Location
    Dallas, TX
    Posts
    245

    Default

    Quote Originally Posted by glitch View Post
    William Colley III's A85 is the closest I've found, Herb has a version with modifications to get it building under modern C compilers:

    http://www.retrotechnology.com/restore/a85.html

    I'm currently using that for most of my development. I've done a little customizing to it, I need to get it documented and up somewhere for download.
    That works perfectly. Compiles with a few minor warnings with GCC on MacOS. Thanks!

    Dave

  7. #7
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    32,467
    Blog Entries
    18

    Default

    Quote Originally Posted by dfnr2 View Post
    That's what I'm doing now, and it works. However, putting that in a makefile would require a lot more prerequisites and a lot more complexity to do a build compared with requiring a single assembler. For each source file, the file would need to be copied into a disk image and a script added or modified in the image to assemble the file, then the emulator would have to be run on the image, then the result would have to be extracted. The reason to not just do the whole ROM image build under CP/M is to be able to have source on github and be able to build easily from that source without lots of extra steps.
    Depends on the emulator. The files shown here are ordinary files in a Linux (or Windows) subdirectory, accessible by either CP/M, MS-DOS, Windows or Linux. Goes back to what I posted on another recent thread about CP/M emulation; namely, there are two approaches. The easiest is just to emulate the CPU and load ordinary CP/M on it. The harder thing is to emulate not only the CPU but also the functionality of CP/M, which allows for integration of the filesystem.

  8. #8

    Default

    I have an emulator that I use to create Makefiles to compile CP/M programs and system images. Let me know if you are interested.
    - Doug

  9. #9
    Join Date
    Dec 2011
    Location
    Dallas, TX
    Posts
    245

    Default

    Quote Originally Posted by dfnr2 View Post
    That works perfectly. Compiles with a few minor warnings with GCC on MacOS. Thanks!

    Dave
    Actually, I spoke too soon. There is a difference between A85 and the CP/M 8080 assembler. The CP/M assembler maps a string "AB" to memory in order, with 41h at the low byte and 42h at the high byte. A85 interprets the string as 4142h, then maps to memory in little-endian order, so 42h is the low byte and 41h is the high byte.

    So All the command strings in the ROMS are assembled backwards unless I replace the "DW" directives for the command strings with "DB". Then the ROM images are identical. The source for DPMON does use "DB" to assemble the command strings, so it assembles correctly.

    Dave

  10. #10

    Default

    This is an area that ZMAC does better in. The "--dri" compatibility mode is pretty good. Also, the commandline emulation I use allows you to conveniently use native CP/M programs in a makefile so there's no issue of compatibility. There is one drawback to using emulation/native CP/M commands - they don't return an error code and so 'make' does not stop on errors. But, that's manageable.
    - Doug

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •