Page 1 of 3

ZX81 emulators with built-in assembler... or...?

Posted: Mon Dec 06, 2021 11:49 pm
by TMD2003
The only ZX81 emulator I know of that has the same kind of built-in assembler as Spin is NO$ZX, and I've always had trouble with that. Now that I have reason to try it again, I always find it gives "Unexpected end of file" errors. I put a RET in my .asm, what more do you want?

Ideally, what I need is something where I can put in the line 1 REM XXXXXXXXXX... (and so on), type my assembler code with an "org 16514" at the top, assemble it, and if I haven't made any miscalculations with the number of Xs in the REM, it gets whammed straight into the REM statement and I can execute it, see what's wrong, reload it, try again, reload it...

Trying to debug 210 bytes of hand-assembled code on a spreadsheet with no indication of what is going wrong and about half an hour of painstaking manual reassembly every time I need to fix one tiny little detail is going to test my patience to breaking point.

Failing that, is there some kind of equivalent of PASMO that'll turn .asm into a loadable .p?

Re: ZX81 emulators with built-in assembler... or...?

Posted: Tue Dec 07, 2021 7:29 am
by mrtinb
I believe The feature you’re looking for is in NO$ZX.

The directive is:

Code: Select all

.z80
.zx81
Look a the sample code provided.

The source for the assemblers in Pascal, on his website here: http://problemkaputt.de/assdis.htm

Re: ZX81 emulators with built-in assembler... or...?

Posted: Tue Dec 07, 2021 7:13 pm
by XavSnap
Hi,
"Unexpected end of file"

In Tasm (or others ?) , you had to add a ".end" directive to close the ASM code.
Better use VB81...

Re: ZX81 emulators with built-in assembler... or...?

Posted: Tue Dec 07, 2021 9:52 pm
by dr beep
TMD2003 wrote: Mon Dec 06, 2021 11:49 pm
Failing that, is there some kind of equivalent of PASMO that'll turn .asm into a loadable .p?
I use SJASM and here you can find how to use it.

https://sinclairzxworld.com/viewtopic.php?f=6&t=4045

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 11:13 am
by Brimbard
Hi,

I am using FASM-ZX which is very tightly integrated with the EightyOne emulator.
It allows you to mix assembler with Basic and start your emulator with a single button. :!:
You simply use labels instead of address numbers (in assembler and Basic as well) so you can freely add and insert code as you want. If you like you can place your assembler in multiple REM-lines or alternatively in a basic variable which will be present after load.

Take a look at viewtopic.php?p=10970#p10970 and you will see that some of your own requests below can be achieved in an easier you than you might expect. :D

The link above contains a zip file which contains the EightyOne as well. you can simply overwrite this old version with the latest one from here https://sourceforge.net/projects/eighty ... -emulator/.

Have fun.

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 11:22 am
by XavSnap
Better use VB81...
:lol: :lol: :lol: :lol: :lol:

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 11:31 am
by mrtinb
This year on the ZX-Team virtual gathering, Matthias had a presentation where he demonstrated an updated version of ZXText2P.EXE, that also launches the EightyOne emulator, and has extended possibilities in your souce file.

http://www.swatosch2.de/Vortrag-t2p.mp4
http://www.swatosch.de/zx81/index.html

(Sorry, this is for Basic programming)

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 11:55 am
by TMD2003
mrtinb wrote: Tue Dec 07, 2021 7:29 am I believe The feature you’re looking for is in NO$ZX.
The directive is:

Code: Select all

.z80
.zx81
Look a the sample code provided.
I did, and I still don't know what I'm doing wrong.

I put 1 REM XXXX into the ZX81, then load TEST.ASM from outside into the assembler. it contains:
LD BC,99
RET
...which is four bytes.

It ends with the line:
END 16514
...which, according to what I understand from the sample file, is the equivalent of putting ORG 16514 in the first line on a Spectrum assembler file.

Whether I include .Z80 and .ZX81 at the top of the file or not, the outcome is the same: something gets poked somewhere, I have no idea where except that it's clearly not 16514, it makes the screen go crazy, and then it crashes.


As for XavSnap's extended VB81 with the built-in Artic ASM2, I don't understand that at all. I have yet to get the above four-byte program recognised - all I get is a blank line 2 instead of seeing it with four bytes in it. And the "Type in ASM" option looked promising but it seems I have to edit byte-by-byte and do the assembly myself, which is exactly what I need to avoid.


This is not a high priority so I'm going to have to leave it for a while.

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 12:15 pm
by bobs
END 16514 would usually mark the end of code and the start address for running it, which isn’t the same as using ORG to specify the start address of the code, but it all depends on which compiler you are using.

Personally I have a system where I use PASMO to compile my source asm directly into a .P file, and then boots up NO$ZX to run it. I covered it in a blog post some time ago - https://bobs8bb.wordpress.com/2018/02/ ... #more-1246 - as part of converting a ZX81 Basic game to machine code.

Re: ZX81 emulators with built-in assembler... or...?

Posted: Wed Dec 08, 2021 2:30 pm
by mrtinb
You might want to try ZX-IDE which can do both Basic and assembler in a specialized IDE for ZX81.

viewtopic.php?f=6&t=1064