ZxList 6, P file to BASIC conversion app

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

Re: ZxList 6, P file to BASIC conversion app

Post by David G » Tue Jul 29, 2014 12:11 am

Glad to hear it's working!

C++ is very small code. The app uses none of optional dynamic linking options of Visual C++ 2008:
* No ATL code
* No MFC code
* No CLR code
Just straight Win32 code and C/C++. Unfortunately it stil uses the MSVCR (Microsoft Visual C Runtime), as I understand, for even the simplest EXE file. It requires Msvcr90.dll, which should be included with your Windows 2000, Windows XP, Windows 7, Windows 8, etc.

EDIT: I just researched how to unlink the C Runtime DLL. It increased the size of the app for 70k to 140k. Attachment updated.

David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

Re: ZxList 6, P file to BASIC conversion app

Post by David G » Tue Jul 29, 2014 1:45 am

A couple of months ago, I was updating a ZX81 arcade game that hadn't been changed since 1982. It was just minor changes to the machine code, but took a very long time. I originally hand-coded (not using assembly language), and so room had to be found, and patched with two Jumps to the few changed bytes. And yet the arcade game was only 543 bytes. I entered it into the ZX81 using ZxMon, a machine code monitor app written just to enter the game code.

I remember (in 1982) my mom typing up the ZXMon code on a typewriter from my hand-written notes. Amazingly she didn't make a mistake. It was 1043 bytes long. So I had the assembly language, although only on paper -- it was all hand-assembled back then.

After that lengthy exercise of updating the arcade game, last month I disassembled it, and used ZX-IDE to make changes and recompile it. So much easier, and I was pleasantly surprised at how easy it was and how ZX-IDE was a real Integrated Developement Environment. Truly as easy as using Visual Studio or Eclipse to make games for phones. I even updated ZXMon, which is available at the Vegagak site.

Then I thought, rather than re-creating apps, what about having a utility to convert a ZX81 app into a format ready ZX-IDE? Then I could easily modify the existing app. ZX-IDE is able to import machine language BIN files, since ZXList already had been exporting them for 15 years. So I modified ZXList to version 6. Now ZXList is more than a diagnostic tool, it is for me a productivity tool. Many thanks to the creator of ZX-IDE.

Back around 1994 I wrote the first version of ZX Lister using Visual Basic 3.0. I had some fun examining programs. It was something I tinkered with every few years.

So that's my story of ZX Lister.

User avatar
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZxList 6, P file to BASIC conversion app

Post by PokeMon » Tue Jul 29, 2014 3:19 pm

Thanks if you think the ZX-IDE is a helpful tool.
I made it for my own developments because I just wanted to have an easy tool and not a tool chain with several assemblers, linkers and so on.
Unfortunately I didn't had too much time to really develop software for the ZX80 or ZX81 machines - but try to keep going on.
It is especially useful to transfer the compilation via LOAD command and sound card to real hardware (F9 - dont press it accidently as it gives horrible noise to the neighbours with maximum volume and let them think the Aliens are on the way ... :mrgreen: ) or to use the emulator by simply pressing F8 or to have a look into the generated code (addresses and much more) by pressing CTRL-F8.

I will implement the SAVE command this summer and with that create an adaptive loader which increases speed of transfer data depending on what the hardware could take, so could be 500 byte/s or 1000 or 2000. I also want to implement a packed transfer (as zip) to increase transfer size and to let a 16k program load in a few seconds via the soundcard of a PC. I think this can be realized. And to implement a partly memory transfer for updating even running programs while updating memory location $4700-$4800 for example. This would offer some cool applications. So I hope to finish this in august.

The other thing I would like to implement is loading binary .p or .o files and to create the listing right you do it with ZxList by just open a .p file automatically. This would give in second step the need of disassembler as well which would be fine to take a look and edit foreign software. I am not sure if your ZxList could be easily integrated in FASMW-ZX as WIN application (32 bit). It could be handled as DLL as well which offers a function to read the binary and output the ASCII listing. So if you think this could match to your application and you would like me to integrate it, it would give more benefit to the users. So up to you. ;)

David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

Re: ZxList 6, P file to BASIC conversion app

Post by David G » Thu Jul 31, 2014 8:10 am

Hi PokeMon,

The partial memory transfer is an excellent idea, and something like that is needed for the ZX81.

I may be able to assist with the P file import as I have coded DLLs before. I will send you a PM.

- David

David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

Re: ZxList 6.3 UPDATE, P file to BASIC conversion app

Post by David G » Sun Aug 31, 2014 11:40 am

6.3 most importantly fixes the graphics codes. Both translation and presentation. (Will use the Sinclair font if it is installed on your PC).
Attached to the first post of the this topic.

This runs on Windows (including Windows XP, Windows 7 and Windows 8).
zxlist63.JPG (53.87 KiB) Viewed 2368 times
* corrected graphics codes in zx2ascii routine
* unlinked MSVRCRT
* added app zx81 icons
* 81 file filter added
* change to 16K specified
* prompt on overwrite of output file
* hexdump: beginning location added in decimal
* Keyword spacing corrected
* Line number spacing corrected
* automatically default to font "SinclairZX" if available
* added scroll bars to the output window
* fixed bug in VARS section when vars was empty
* improved REM translation (including TOKENS)
* handle input file from command line
* add option to cancel Save REM (useful for programs with multiple M/C REM statements)

Known Issues:
* TOKENs in REM not spaced same as in statements (i.e. "REM TO ")

David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

ZxList 6.4, now disassembles machine code

Post by David G » Fri Sep 19, 2014 10:18 am

Just posted ZxList 6.4 to the first post of this topic. It may be downloaded from there.

No dependents, should run on any 32 or 64 bit Windows.

6.4 changes:
* added disassembly of REM machine/code statements
* fixed overwriting of ASM/BAS files
* Byte dumps are now pre-pended correctly
* Now validates ZX81 file on opening
* Add menu items for accessibility
* memory needs reduced



Posts: 20
Joined: Sun Dec 20, 2015 12:09 pm

Re: ZxList 6, P file to BASIC conversion app

Post by bru65pag » Sun Dec 20, 2015 12:26 pm


I resumed my ZX81 programming this year (34 years passed by), and decided to learn assembly. Let me first thank you a lot for both ZX-IDE and ZxList, those tools definitely help me a lot (there was mention in 2013 of possibly integrating ZxList into ZX-IDE, that would be fantastic).

I have two questions:
1/ I noticed that ZxList recognises undocumented Z80 instructions (see http://www.z80.info/z80undoc.htm). However, ZX-IDE does not. Is there a way to solve this problem on my side (a config file to modify), or is this an existing/known "limitation"?

2/ ZxList has the ability to generate a memory dump, which I find useful. The generated syntax is compatible with the ZX-IDE, so it should not be an issue to display in it. However, because of the non standard characters generated by the dump I guess, ZX-IDE is crashing at opening of such a file. I guess it has to do with the character set (ASCII, UTF, ...). Is there a way to have it fixed on my side (either by configuring ZX-IDE, or saving the .ASM file in a specific format, like UTF-8 (although I do not know how to do that in windows), or is it an existing/known "limitation" ?

Thanks a lot for your work and support. Bruno.

User avatar
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZxList 6, P file to BASIC conversion app

Post by PokeMon » Sun Dec 20, 2015 5:39 pm

Hi Bruno,

thanks for feedback and good to know you find the ZX-IDE helpful.

About the undocumented opcodes - these have been added in october 2014 and is present in the current release. I forgot to link this topic in the first posting where you can download the current release and forgot to delete the statement that undocumented opcodes are not supported. ;)
See here:
http://sinclairzxworld.com/viewtopic.ph ... 4&start=30

And the ZXlister has been implemented but this is still an experimental feature. You could try to open ZX binary from the file menu. This module is still buggy and may work, crash or give wrong results under several circumstances. The main problem I found is that the ZXlister can not handle plain data sections and interpretes them sometimes as code, too.

I discussed this stuff with David and at the end we didn't have a real solution for it and I still did not hear any more from David. I doubt the ZXlister is updated or supported in future. I wanted to integrate another tool for disassembling code but still had no time for extending the ZX-IDE with that feature. You may test you application with it - the wrongest thing can happen is crash of ZX-IDE and you have to run it new.

You may also post here a file you created with ZXlister (I didn't use this from command line personally) and I could check the problem when opening it. I am in holiday soon - so please don't expect a reliable answer this year. :mrgreen:


Posts: 20
Joined: Sun Dec 20, 2015 12:09 pm

Re: ZxList 6, P file to BASIC conversion app

Post by bru65pag » Sun Dec 20, 2015 10:42 pm

Hi Karl,

Thanks for the prompt answer. I was not so sure you were still active in this forum, happy to see that ZX-IDE is still supported :-)

1/ I had not noticed the 'Open ZX binary' option in the file menu. That is great.

2/ I am using version 0.95.11 of ZX-IDE, which I believe is the latest version. When using one of the undocumented Z80 opcode, I ran into the following error:
LD IYH, 0x38 => Invalid operand
I don't quite understand what is wrong.

3/ About the supported character set, I believe I did not explain properly what my issues are:
3.1 - Reading a file with some non ASCII characters seems to crash ZX-IDE. Any clue why?
3.2 - I followed your suggested thread, and went to install ZX81.ttf font on my windows 8 system. All went well. But now, when trying to toggle to graphic mode from within the program using ALT+9, ZX-IDE is crashing. Should something specific be done before?

4/ Additionally, you or somebody might be able to help me with the EightyOne simulator. I believe there is an help file existing for this program, but there is no way I can find it (the site from its author seems to be dead). Would that file (if it exists) be include in ZX-IDE? As intuitive as EightyOne can be, I would still like to read the help file, it might be useful to understand some features I guess.

I wish you a happy holiday season, and am looking forward to get some feedback.

Best regards. Bruno.

User avatar
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZxList 6, P file to BASIC conversion app

Post by PokeMon » Mon Dec 21, 2015 12:00 am

Version string for the ZX-IDE appears in the window title and should be:
"flat assembler 1.71.01p.Z80 10/2014"

This is the latest version.
About the instruction you are right, I think I missed to implement LD IYh,n.
LD IYh,r (register A-L) is working. So will make an update after new year for it.

I think there is a problem when installing the font. I never tested this under WIN8 - have only WIN7. Are you sure it is correctly installed ? Is the font available when you open MS Word for example or other office application ? There maybe a security issue with unsigned fonts - maybe - or you have to be admin to install fonts. That could be the reason when opening files with non ascii chars as this does automatically ALT-9 for getting the zx81 font bar.

Regarding EightyOne - I never saw a help file about it.
You may post questions about here at the forum as there are many persons familiar with EightyOne.
Please open a new thread for EightyOne questions.

Post Reply