Hex to Binary conversion - CP/M

This is a discussion on Hex to Binary conversion - CP/M ; I wanted to try an old Tarbell FDC (uses the 1771 chip) on my S-100 bus machine. I wrote a small Z80 assembler program that is ORG'd at 100H and contains the drivers and code necessary to move the drivers ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: Hex to Binary conversion

  1. Hex to Binary conversion

    I wanted to try an old Tarbell FDC (uses the 1771 chip) on my S-100 bus
    machine.
    I wrote a small Z80 assembler program that is ORG'd at 100H and
    contains the drivers
    and code necessary to move the drivers to upper ram (at C400, just
    below my CCP).
    It also patches my BDOS code so that it checks the Tarbell drivers
    first and then
    uses the regular CBIOS calls for other than the Tarbell ones.
    This logic allows me to plug in a floppy controller and different
    floppy drives to use
    in different ways. For example, I have an TEI FDC and a 360k drive
    that I can create
    and read Morrow floppies on my S-100 system.

    In my Tarbell program, I have a section ORG'd at 100H and another at
    C400H.
    I have two ways of making a binary com file:
    1. I can run a program called HEXBIN which converts the HEX file to
    Binary. It
    also puts in 00H bytes below 100H and between the loader section
    and the
    start of the resident code at C400H. I then have to take the binary
    file into
    my VEDIT editor (in Hex mode) and remove all the added 00H's.
    2. I can edit the HEX file into two sections, calculate the bias and
    create a com
    file using DDT and the SAVE command.
    Note: part of the above procedures are done under DOS and part under
    CPM
    running the MYZ80 emulator.

    What I would like to find some way of just taking my original HEX file
    and
    creating a binary without using the load addresses. A program could
    just
    take each HEX line and (starting at 0000h) convert each Hex code byte
    to
    binary ignoring the load address. Anyone know of such a program ????

    Another thought:
    Is there away to have the Z80 Assembler add a calculated number of 00H
    bytes at a selected place in a program. For example, if section 1 of a
    program
    ends 10 bytes short of a parge boundry, I might like to have 10 bytes
    of 00H
    added, so that section 2 starts on a page boundry. I sometimes add 00H
    bytes when the code is going into EPROM.
    I know you can put a calculated value name in a DEFS statement, but I
    would
    like to have the area initialized like in a DEFB statement.
    I generally use Cromemco's Z80 assembler, but also have ZMAC and SLR
    assemblers.

    Any suggestions will be appreciated.
    Old-Timer (John)


  2. Re: Hex to Binary conversion

    > What I would like to find some way of just taking my original HEX file
    > and
    > creating a binary without using the load addresses. A program could
    > just
    > take each HEX line and (starting at 0000h) convert each Hex code byte
    > to
    > binary ignoring the load address. Anyone know of such a program ????


    It would be easy enough to write one. I'd do it in BASIC even!

    Tom Lake



  3. Re: Hex to Binary conversion

    Hello, "Old-Timer"!

    Well, you don't seem to be very familiar with assembly language,
    or the way your assembler behaves... Also, since I am not a native
    speaker of English, it took me several readings to finally understand
    what you want to do. (Several months ago, I publicly asked for the
    photocopy of an article dealing with an installable BIOS, but nobody
    ever answered... You seem to want to do the same.)



    > Is anybody out there
    > who has the following LIFELINES article:


    > - "A Dynamic CP/M BIOS Extension Technique"
    > M. Karas
    > LIFELINES, Vol.3, No.8 (page unknown)


    > I found its reference in another article (in a DDJ
    > magazine: I have not one LIFELINES magazine).
    > I need it to finish one project.


    Back to your message:

    > What I would like to find some way of just taking my original HEX file
    > and
    > creating a binary without using the load addresses. A program could
    > just
    > take each HEX line and (starting at 0000h) convert each Hex code byte
    > to
    > binary ignoring the load address. Anyone know of such a program ????


    Of course: DDT and SID, which can load a HEX file with an offset...
    (Seems also that you don't know that the standard Z-80 assembler under
    CP/M, M80, has a ".PHASE" and ".DEPHASE" pseudo-ops.)

    > I have two ways of making a binary com file:
    > 1. I can run a program called HEXBIN (...)
    > 2. I can edit the HEX file into two sections (...)


    ??? Why not use LOAD?

    > Another thought:
    > Is there away to have the Z80 Assembler add a calculated number of 00H
    > bytes at a selected place in a program.


    What could be simpler? See the IRPC pseudo-op of MAC, the standard
    CP/M macro-assembler (producing HEX files).

    > (...) I might like to have 10 bytes of 00H
    > added, so that section 2 starts on a page boundry.


    This was done in several programs made by Digital Research...
    Please, re-read your CP/M documentation!

    > I generally use Cromemco's Z80 assembler, but also have ZMAC and SLR
    > assemblers.


    Why don't you simply use the standards,
    that were given with CP/M, and came
    with their manuals in the standard CP/M documentation?

    If I have well understood, your program is in 2 parts:
    a relocator, and the subroutines. The relocator will
    probably run at 0100H, so it is a standard CP/M
    COMmand file. The subroutines are relocated at
    the top of the TPA, just below the BDOS. That's
    exactly what DDT and SID are doing, and that Gary
    Kildall explained in a DDJ article, about 25 years ago...
    (Are you really such an "Old Timer"?) The snippet of
    code used to relocate the body of DDT/SID is less
    than 256 bytes long, so fits easily in one "page". The
    size of the subroutines is, of course, variable in size,
    and is not important, since the relocator can deal with
    most sizes.

    In conclusion: have the things clear in your head,
    and you will speak clearly, we will understand you
    clearly, and you will program clearly. If you don't
    know how to do something, just ask, or try (like me)
    to find interesting articles written at the time.

    (If you have a CP/M Plus system, re-read the RSX doc.)

    Yours Sincerely,
    "French Luser"




  4. Re: Hex to Binary conversion


    French,

    Man, you're coming off pretty arrogant in that last message.. lol.
    Is it because english is not your native tongue? If you enjoy
    razzing people (I can hear it now, "what it means -- to razz?), go
    after those goofs who come to the CP/M forum wanting to learn how to
    make DOS boot disks.

    ~ J


  5. Re: Hex to Binary conversion

    On Sat, 18 Mar 2006 11:43:31 +0100, "French Luser"
    wrote:

    >Hello, "Old-Timer"!
    >
    >Well, you don't seem to be very familiar with assembly language,
    >or the way your assembler behaves... Also, since I am not a native
    >speaker of English, it took me several readings to finally understand
    >what you want to do. (Several months ago, I publicly asked for the
    >photocopy of an article dealing with an installable BIOS, but nobody
    >ever answered... You seem to want to do the same.)
    >
    >
    >
    >> Is anybody out there
    >> who has the following LIFELINES article:

    >
    >> - "A Dynamic CP/M BIOS Extension Technique"
    >> M. Karas
    >> LIFELINES, Vol.3, No.8 (page unknown)

    >
    >> I found its reference in another article (in a DDJ
    >> magazine: I have not one LIFELINES magazine).
    >> I need it to finish one project.

    >
    >Back to your message:
    >
    >> What I would like to find some way of just taking my original HEX file
    >> and
    >> creating a binary without using the load addresses. A program could
    >> just
    >> take each HEX line and (starting at 0000h) convert each Hex code byte
    >> to
    >> binary ignoring the load address. Anyone know of such a program ????

    >
    >Of course: DDT and SID, which can load a HEX file with an offset...
    >(Seems also that you don't know that the standard Z-80 assembler under
    >CP/M, M80, has a ".PHASE" and ".DEPHASE" pseudo-ops.)
    >


    There are so many things wrong with this message that even I am
    ashamed. M80 was a microsoft product, it never was included with cp/m,
    the default is asm and the upgrades from DR were mac and rmac. Sid
    isn't there under 2.2 which is most likely what he is running if he is
    using myz80 as his cross system.

    What I understood him to want was a way to make the file as a .prl so
    that it would be page relocatable. Which would then be converted to
    binary with prlcom, which were included with mp/m and cpm3 but not
    2.2.
    thanks, Primo.



  6. Re: Hex to Binary conversion

    French ,
    Sorry I never saw the origional request.
    Have you tried this link ?
    http://home.earthlink.net/~z100lifeline/lifeline.html
    Mark.


  7. Re: Hex to Binary conversion


    "Mark Whitlock" wrote:

    > French ,
    > Sorry I never saw the origional request.


    Just use Google -- Groups -- comp.os.cpm (like me).

    > Have you tried this link ?
    > http://home.earthlink.net/~z100lifeline/lifeline.html


    No, this was a complete novelty for me.

    I wish someone could set up such a good Web site for
    the (English) Amstrad CPCs and PCWs. (Personally,
    I am a fan of the Epson QX-10.)

    You, Americans, are very lucky to have fans
    with the time and money to set up Web sites
    like this.

    (The only problem is that I could find no software?)

    Yours Sincerely,
    "French Luser"




  8. Re: Hex to Binary conversion

    "mdnttrain" wrote:

    > French,
    >
    > Man, you're coming off pretty arrogant in that last message.. lol.
    > Is it because english is not your native tongue? If you enjoy
    > razzing people (I can hear it now, "what it means -- to razz?), go
    > after those goofs who come to the CP/M forum wanting to learn how to
    > make DOS boot disks.


    Me, arrogant? Re-reading the first message in this thread
    and my answer, all I can see is that I answered straight
    on target what he asked.

    However, I failed to see any technical information your
    own message could bring to him (or to the other people
    still reading the comp.os.cpm Newsgroup).

    Your message only appears to contain one opinion.
    And opinions are just worth the value of an opinion,
    that is to say: nothing, but noise.

    If you had wanted to be useful, you would have
    found this article, retyped it, and submitted it,
    so we could learn one more way to relocate
    subroutines in TPA.

    (According to Google, I submitted about 30
    BASIC programs over the years, among them
    LOADHEX and SAVEHEX, and a lengthy
    discussion about the formats of 8-bits and
    16-bits HEX files. Those programs will
    relocate anything you want in TPA.)

    "French Luser"




  9. Re: Hex to Binary conversion


    Tom Lake wrote:
    > > What I would like to find some way of just taking my original HEX file
    > > and
    > > creating a binary without using the load addresses. A program could
    > > just
    > > take each HEX line and (starting at 0000h) convert each Hex code byte
    > > to
    > > binary ignoring the load address. Anyone know of such a program ????

    >
    > It would be easy enough to write one. I'd do it in BASIC even!
    >
    > Tom Lake



  10. Re: Hex to Binary conversion

    Hi John
    Hex to binary and binary to Hex are so trivial to write
    that I don't see why you don't write your own special
    purpose one. You might give an input parameter that
    states the range of addresses to convert from. Use
    your favorite language of choice.
    Dwight


  11. Re: Hex to Binary conversion

    French Luser wrote:
    > "mdnttrain" wrote:
    >
    >
    >>French,
    >>
    >> Man, you're coming off pretty arrogant in that last message.. lol.
    >> Is it because english is not your native tongue? If you enjoy
    >>razzing people (I can hear it now, "what it means -- to razz?), go
    >>after those goofs who come to the CP/M forum wanting to learn how to
    >>make DOS boot disks.

    >
    >
    > Me, arrogant? Re-reading the first message in this thread
    > and my answer, all I can see is that I answered straight
    > on target what he asked.
    >
    > However, I failed to see any technical information your
    > own message could bring to him (or to the other people
    > still reading the comp.os.cpm Newsgroup).
    >
    > Your message only appears to contain one opinion.
    > And opinions are just worth the value of an opinion,
    > that is to say: nothing, but noise.
    >
    > If you had wanted to be useful, you would have
    > found this article, retyped it, and submitted it,
    > so we could learn one more way to relocate
    > subroutines in TPA.
    >
    > (According to Google, I submitted about 30
    > BASIC programs over the years, among them
    > LOADHEX and SAVEHEX, and a lengthy
    > discussion about the formats of 8-bits and
    > 16-bits HEX files. Those programs will
    > relocate anything you want in TPA.)
    >
    > "French Luser"
    >
    >
    >

    Sorry, French, I have to agree with mdnttrain. When I first read your
    reply to Tom, I could see that you were giving him lots of good
    information, but apparently couldn't resist giving his nose some tweaks
    in the process.

    You say
    > "all I can see is that I answered straight on target what he asked."


    But you also said,

    o you don't seem to be very familiar with assembly language,
    or the way your assembler behaves

    o it took me several readings to finally understand
    what you want to do.

    o Seems also that you don't know that the standard Z-80 assembler under
    CP/M, M80, has a ".PHASE" and ".DEPHASE" pseudo-ops.

    o Why don't you simply use the standards, that were given with
    CP/M, and came with their manuals in the standard
    CP/M documentation?

    o ... and that Gary Kildall explained in a DDJ article, about 25
    years ago... (Are you really such an "Old Timer"?)

    o have the things clear in your head, and you will speak clearly,
    we will understand you clearly, and you will program clearly.

    I have seen you around this NG for quite some time, and I have seen that
    you are very knowledgeable about CP/M, and usually quite willing to help
    other people with problems. But you could have answered the man's
    questions without telling him how dumb he was, or questioning just how
    old a timer he is.

    Do me a favor: If _I_ ever aske a question here, don't answer.

    Jack

+ Reply to Thread