Trying to make HEX code

Discussion in 'Embedded Systems and Microcontrollers' started by resystor, Nov 21, 2008.

  1. resystor

    Thread Starter New Member

    Nov 21, 2008
    I have assembled a program for my Z80. I've searched the internet high and low on how to make a HEX code file which I need to down load into the RAM. I'm pulling my hair out. I don't know how to use debug. I am using TASM compiler which does not seem to make a HEX file and I have a LINKER but only makes a MAP file. Please Help!
  2. davebee

    Well-Known Member

    Oct 22, 2008
    What kind of Z80 system do you have? What kind of loader program does it have? What form of input file does the loader need?

    As I remember, there are several different formats of hex files, like Motorola, Intel and maybe others.

    I thought TASM was able to produce a number of different output formats, so I'm surprised that you're not seeing at least something, even if it fails to load.
  3. resystor

    Thread Starter New Member

    Nov 21, 2008
    It has a z80 cpu ram rom ctc and usart. i'm using Hyperterminal to try and load programs into the RAM
  4. davebee

    Well-Known Member

    Oct 22, 2008
    Here's an example of what has worked with my Z80 board:

    tasm.exe -80 -x -a15 temp.asm > temp.txt

    Here's the arguments my version of TASM can accept:

    tasm -<nn> [-options] src_file [obj_file [lst_file [exp_file [sym_file]]]]
    Option Flags defined as follows:
    -<nn> Table (48=8048 65=6502 51=8051 85=8085 80=z80)
    (68=6800 05=6805 70=TMS7000)
    (3210=TMS32010 3225=TMS32025)
    -t<tab> Table (alternate form of above)
    -a Assembly control (strict error checking)
    -b Produce object in binary format
    -c Object file written as a contigous block
    -d<macro> Define macro
    -e Show source lines with macros expanded
    -f<xx> Fill entire memory space with 'xx' (hex)
    -g<x> Obj format (0=Intel,1=MOSTech,2=Motorola,3=bin)
    -h Produce hex table of the assembled code
    -i Ignore case in labels
    -l[al] Produce a label table in the listing[l=long,a=all]
    -m Produce object in MOS Technology format
    -o<xx> Define number of bytes per obj record = <xx>
    -p<lines> Page the listing file
    -q Quiet, disable the listing file
    -r<kb> Set read buffer size (KB)
    -s Write a symbol table file
    -x<xx> Enable extended instruction set (if any)

    Maybe your TASM arguments need to be adjusted to match your Z80 board.
  5. AlexR

    Well-Known Member

    Jan 16, 2008
    You should be looking at your linker options rather than the assembler. I can't give you any specific advice since I have never used tasm but the assembler/compiler output is normally an object file. The thing that produces the final output file, exe, hex or whatever output format you need is the linker program and its output format is specified in the linker options.