Setting up Assembler and Hex editor in Programmer’s Notepad

This page will help you set up the free TASM Assembler and free XVI32 Hex editor in Programmer’s Notepad

(I’m looking into doing this with Notepad++ too for those that prefer to use that)

Assembler:

I’m now using the free TASM assembler by Squak Valley Software, their home page ( www.tasmhome.com ) does not seem to be active anymore and I could not find a way to contact them to request permission to host a copy of TASM, I am therefore going to host it until requested otherwise.

TASM32 Download

There is no installation for the TASM, you just need to put it somewhere easily accessible, preferably in a path with no spaces in the name. (I have it on my dropbox in a z80 folder, I use the DOS “SUBST” command to create a Z: drive which is the Z80 folder. I will make a page showing you how to do this soon):

  • In Programmer’s Notepad go to Tools -> Options
  • In the Dialogue box, select Tools

  • In the Scheme drop-down, select Assembler and click on Add.

  • Copy the same details as shown into your dialogue. Name can be whatever you wish, and Command must point to the correct location for you copy of TASM.EXE
I have Save set as Current File so it will save the file before it assembles as it works on the file itself, not what is currently shown in the Programmer’s Notepad window, I’ve worked with people in the past who have gotten confused when using IDE’s that didn’t save when you hit compile and wondered why none of their changes were showing up in the resulting files.
Now you should be ready to go!
Notes to keep in mind:
  • You need to copy the TASM80.TAB file into the folder of the assembly files you are assembling, I still haven’t found a way around this yet unfortunately.
  • The current file shown will be sent to the assembler, so if you have a driver shown and select assemble in the menu, it will most likely fail and give you a lot of errors. (I’m going to figure out how to set up projects and doing project assembling using programmer’s notepad eventually)

A little explanation of the parameters used:

  • -80  Tells TASM that we are assembling for the Z80 (This assembler supports multiple processors)
  • -x  use extended instruction set if available (Not needed for the Z80 but I never bothered removing it)
  • -g3  select binary format for output (as opposed to Motorola or Intel, etc…)
  • -c  Tells TASM that the code is written as a contiguous block (makes sure the output binary file is padded with 0x00’s when there is a gap in the addresses in the assembly code, such as when you use .ORG to specify the location of the next block of code to start)
  • %f  This is replaced by Programmer’s Notepad to become the current filename, this is specifying the input file into TASM
  • %n.bin  The %n is replaced by Programmer’s Notepad to be the current filename with it’s extension stripped, and I added .bin to the end as I wish for a .bin extension to my output file, this specifies the output filename for TASM to assemble to.

If I was working on m62bios.asm and selected the assemble command in the menu, it would run this command:

z:\ASM\tasm32\TASM.EXE -80 -x -g3 -c m62bios.asm m62bios.bin

If you choose to change the extension of your output binary, replace the .bin in the parameter with your choice, but make sure the “Open with XVI32” command is changed accordingly as that is set to use .bin

Assembling for application/standalone code to be used with the M62 BIOS’s binary receive function:

If you are assembling application/standalone you need to omit the -c option from the parameters of TASM or it will pad the output file with 0x00’s until it reaches the specified location where we want the code to run from. I suggest following the steps above to add a separate command and just omit the -c

Hex Editor:

XVI32 is a pretty decent free hex editor that I have been using for many years, it can be downloaded here.
Note: These instructions should work fine with other hex editors, you just need to change the command box to point to your prefered hex editor, I just happen to use XVI32.
Having a hex editor lets you view the output of TASM to see that everything has come out properly.
To add it to Programmer’s Notepad, follow the same instructions as above but use the following settings:
If you have changed your output binary extension, you will need to change %n.bin to reflect that change.