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

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
TMD2003
Posts: 149
Joined: Sun Oct 11, 2020 5:39 pm

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

Post 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?
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

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

Post 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
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

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

Post 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...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
dr beep
Posts: 2060
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

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

Post 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
Brimbard
Posts: 10
Joined: Wed Dec 01, 2021 8:12 pm

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

Post 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.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

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

Post by XavSnap »

Better use VB81...
:lol: :lol: :lol: :lol: :lol:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

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

Post 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)
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
TMD2003
Posts: 149
Joined: Sun Oct 11, 2020 5:39 pm

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

Post 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.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
bobs
Posts: 325
Joined: Thu Aug 27, 2009 10:49 pm
Location: UK
Contact:

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

Post 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.
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

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

Post 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
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply