Home

Z80  Programming  III-a

TASM .asm, .obj, .lst Files

Page a          Page b          Page c

Assembly time

Create a folder on your desktop and move your NOPs-0000.asm file there. I'm calling my folder NOP.

In PN, click "Tools" followed by "Z80 Assembler (TASM32)" if that's what you named your tool launcher. The result should be what you see below. Notice how an Output panel opens in the PN window indicating "Number of errors = 0"?  If you did get an error, it was most likely "tasm: table file open error on tasm80.tab". In that case, copy the tasm80.tab file to your code folder and try again.

    

Ok, so what did we assemble? Assuming your NOPS (or whatever) folder is on your desktop, there should now be two new files in it: NOPS-0000.lst and NOPS-0000.bin (you might see a .obj file instead of a .bin file, depending on how you configured TASM). The former is a program listing file that contains not just the source code you wrote but also the machine code combined into one file. The latter is just the machine code.

 

.LST file

If PN is your default editor then you should be able to simply double-click the .lst file to open it. Below you can see PN has both files open now with the .lst file in the active tab (red frame surround).

If you compare that with the original .asm file, they almost look the same. Sort of. The PN line numbers are still there but now there are assembled line numbers to the right of them. Further to the right is the address of the line items, all of which are irrelevant until line decimal 7 when we finally see the NOP instruction. This is the first instruction composed of machine code 00 at position $0000 into the file.

In decimal line 8 we see more of the same except that the address is now 0001 for code 00.

In line 9 it's address 0002 for code 00.

Line 10 shows address 0003 but there is no machine code beside it.

And finally in line 11, we see address 0003 again with no code beside the address but we do see the ".end" directive to the assembler.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.BIN file

Which file does the CPU use, which one do we burn into an EEPROM?  The .bin file; let's have a look at it.

Double-click NOPs-0000.bin from within PN. You should get a warning that Windows can't open it, so choose "Select a program from a list of installed programs" (Windows 7), hit OK, and choose PN. Don't forget to check "Always use the selected program..." so you don't have to repeat this action unnecessarily. The result should be a single line containing 3 NUL tags. This is not what we want so close this tab. Click on Tools and try to find the two tools you configured earlier. They're gone, aren't they? That's because you configured them when Assembler was the drop-down file type. Click on the drop-down, select Assembler, now find and select your "Open .bin in XVI32" tool. The results are shown below.

The area that is highlighted reads "Value 00 is shown at address $0000." Well this looks kind of boring but now you know how to startup the editing tool that we'll use at a later time.

 

 

NEXT PAGE  =>

 

TOP

 

Home