#zenas — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #zenas, aggregated by home.social.
-
Things the zenas Z80/Z80N assembler lets you do that other assemblers cannot do:
No. 4 - C-style macros
https://github.com/ha1tch/zenas/blob/main/docs/ZENAS_PROGRAMMING.md
#zenas #asm #z80 #assembler #golang #foss #z80n #retrocomputing
-
These tables show the density of useful annotations per byte. A smaller number on the rightmost column means more useful comments for a binary of the same size.
For example: for the title Dan Dare, zendis will generate a useful comment or annotation every 373 bytes on average. Of course, density will vary inside a binary, because a large portion of game binaries is typically graphics and game data, and a relatively smaller part is code. But this is still useful as a general guide to understand which titles can be analysed more straightforwardly, for educational purposes.
#zendis #disassembler #asm #assembler #z80 #zenas #ZXSpectrum #Speccy #Spectrum
-
I've been adding an automatic assembler annotator to the zendis disassembler. It's based on a combination of heuristics and statistical analysis, with 500+ patterns of assembler sequences commonly found across the corpus of 300+ ZX Spectrum titles, with assembler patterns classified in four different tiers.
This makes it ultra fast and it doesn't use ML inference to work. At the same time, this is an analysis of how many pattern matches I can find per title, which is auspicious and a good start but by no means something that will annotate with good comments any disassembly with sufficient detail to make it understandable.
Work in progress.
#zendis #disassembler #asm #assembler #z80 #zenas #ZXSpectrum #Speccy #Spectrum #retrocomputing
-
Things the zenas Z80/Z80N assembler lets you do that other assemblers cannot do:
No. 3 - Go-style testing
https://github.com/ha1tch/zenas/blob/main/docs/ZENAS_PROGRAMMING.md
#zenas #asm #z80 #assembler #golang #foss #z80n #retrocomputing
-
Things the zenas Z80/Z80N assembler lets you do that other assemblers cannot do:
No. 2 - Assert on machine state
https://github.com/ha1tch/zenas/blob/main/docs/ZENAS_PROGRAMMING.md
#zenas #asm #z80 #assembler #golang #foss #z80n #retrocomputing
-
Things the zenas Z80/Z80N assembler lets you do that other assemblers cannot do:
No. 1 - Run the code you assemble
https://github.com/ha1tch/zenas/blob/main/docs/ZENAS_PROGRAMMING.md
#zenas #asm #z80 #assembler #golang #foss #z80n #retrocomputing
-
zendis v0.4.0
zendis is a disassembler for the Z80 and Z80N
zendis is a new sibling to zen80 (a Z80/Z80N CPU core) to zenas (a Z80/Z80N assembler) and to ZenZX, the companion ZX Spectrum emulator that reuses the former.
Its hex output format matches what zenas accepts as input, so a zendis listing can be fed straight back into zenas, it can interpret plain .bin files at a starting --org address, and it can reuse the zentools sibling library to import .tap, .tzx, .pzx .sna, .szx and .z80 Spectrum binaries.
It supports various output formats, including formats compatible with other Z80 assemblers: plain / listing / json / zenas / pasmo / sjasmplus / snasm.
The listing format is the default and it prefixes every line with the resulting memory address for each instruction (pictured below). The plain format is just the instructions without addresses. The JSON output format allows for feeding zendis output into other tooling and pipelines.Repo:
https://github.com/ha1tch/zendis#readmeBinaries released for 17 modern architecture/platform pairs
https://github.com/ha1tch/zendis/releases/tag/v0.4.0#zenas #zendis #disassembler #disassembly #z80 #z80n #retrocomputing #golang #foss #programming
-
zenas v0.11.2
update:
This version extends coverage of the Z80 instruction set implementing various undocumented instructions, and extends compatibility features with pasmo and sjasmplus, as well as some minor bugfixes.
Binary releases for 17 modern architecture/platform pairs:
https://github.com/ha1tch/zenas/releases/tag/v0.11.2 -
Update: Zenas 0.9.0
bugfix release
zenas is a Z80 and Z80N macroassembler with incredible superpowers you wouldn't believe
This release plugs a number of notable omissions: zenas had no encoding for BIT/RES/SET n,(IX+d)/(IY+d), or for the indexed rotate/shift forms either (RLC/RRC/RL/RR/SLA/SRA/SRL). All these now assemble correctly without workarounds needed.
A hex literal written the traditional way (a leading 0 when the first significant digit is itself a letter, so it doesn't get parsed as an identifier: 0BCH, 0FFh, 0DEADh) was misread as a broken 0b-prefixed binary literal, or split into a stray 0d token plus a leftover identifier. Fixed and no longer an issue.
Binary builds available for 17 modern architecture/platform pairs.
-
Debugging my macros. The good thing is that after you have some well designed macros, most of the simple text user interface things behave almost like BASIC, or terminal printing in Pascal.
Also a good chance to dog food myself using the barely improved editor, and trying to make the zenas assembler work and assemble my non-trivial Z80-based text editor. Dog food is good food!
The only problem I found today was a regression in the vim-like command to jump to a line number. One other thing I noticed is that horizontal scroll doesn't work reliably when you have very long lines that extend beyond the right margin.That being said, It's a little miracle I have never seen it crash, not a single time, during actual development work.
The best of news is that there are not many news on that front!#bim #tbim #zenas #z80 #zen80 #zenzx #retrocomputing #ZXSpectrum #speccy #Spectrum
-
tbim, bim, zenas, zen80
Yes, of course all of these things can be done mixing and matching disparate tools in some other ways, but as a matter of access and code legibility you will be able to directly examine every single bit of the toolset and toolchain.
Every single bit traceable, nowhere left for bits to hide. That's something you can't do unless you're a highly sophisticated specialist today.
#bim #tbim #zenas #zen80 #zenzx #retrocomputing #golang #foss
-
zenas, zen80, bim and assorted tools
Things starting to fall into place like Tetris bricks!
I still can't glue the ZenZX emulator to the text mode editor, but when I decouple the text mode renderer from the editor logic (sometime next year), I should be able to render the editor and other tools using Deluxe UI in a GL-accelerated window, and I should be able to embed ZenZX in a bim pane.
But essentially everything you see in this screenshot, from tiling manager, to editor, to assembler, to emulator, is one single coherent and consistent codebase (with the sole exception of the Spectrum ROM!)
Lots of work ahead in 2026!
Longer term project beyond 2026 will be to get the language ual off the ground and port all these things to ual.
#bim #tbim #zenzx #zen80 #zenas #foss #golang #retrocomputing #z80
-
And if we replace that 255 with a 256 we'd be occupying the space of a 16-bit integer, which the test_func shouldn't accept.
And now it won't! It works!
-
-
zenas - z80 assembler
zenas gains basic C-style macros. The .MACRO_STYLE directive works for the most basic cases passing simple parameters.
Notice the very subtle difference between these two most basic code examples. One of them uses a constant value, the other uses a variable parameter to perform an operation.
Up next I'm working on call-block style (not inline) function calls, juggling multiple parameters, return values and other nice things on the drawing board. Possibly the most important external tool is the z88dk library importer, which I'm still drafting on the back of my mind.
-
Ok traditional-style assembler macros are working almost perfectly now.
Work on C-style macros is ongoing. Zenas is already able to parse C macro definitions and use that to generate inline Z80 code using the fast register calling convention.
In C-Style mode, you must have at least one routine called 'main', otherwise the assembler will emit zero bytes. You not only need to implement your macros, you need them to be called by somebody in order for them to be instantiated and inlined, and that initialisation is typically done in main().
More work needs to be done to support C-style macros that call C functions in compact reusable / re-entrant mode (not emitted inline).
It's not C, but I can imagine these C-like fearures being helpful to reduce programming errors.
I'm also working on an importer that allows you to reuse most Z88DK assembler libraries, whilst translating all of Z88DK's C stubs to Zenas C-style macros.
-
Now entertaining the possibility of crafting a minimally working version of ual using zenas.
Not sure how far away from that I am, could still be a year or more away.
-
-
Experimental. Doesn't work well yet. Will take time to get this right.
-
zenas Z80 assembler
Adding translation of UTF-8 string literals for international character sets of well known speccies, cpc, and msx.
Should probably add blocky characters and other non-alphanumeric glyphs. That will come later.
#z80 #retrocomputing #ZXSpectrum #tk90x #inves #speccy #spectrum #zenas #zen80 #didaktik #tk95 #cpc #msx
-
So... I've had this under wraps for months, whilst I've been adding features and ironing out bugs...
I've already been showing:
zen80: zexall-tested z80 emulator
https://github.com/ha1tch/zen80zenZX: ZX Spectrum emulator (WIP)
https://oldbytes.space/@haitchfive/115159221509967137
The next logical piece is:
- zenas: Z80 assembler (WIP)
zenas is a new Z80 assembler (work in progress) following a simpler design than my earlier attempt. This is designed to work together with zen80 and zenZX, to hot test and benchmark the code the assembler emits
I'm already seeing some promising results. I think it's a cool feature if your assembler can actually run the code it emits (using zen80) with the potential to verify your object code actually works, and every single cycle is accounted for. I can imagine in the future we can expect to have things like register colouring and other neat features.
If we consider the zenXX tools together with the tape handling tools, and with the floppy image tools, we're approaching the status of lovely toolset that could one day be quite useful.
#zen80 #zenzx #zenas #asm #z80 #golang #foss #assembler #retrocomputing