VOGONS


First post, by lins08

User metadata
Rank Newbie
Rank
Newbie

Not a very popular subject I am sure… I usually manage to muddle through without an assember to write some small programs but the Z8001 seems to be the exception! I’ve just built a small Z8001 SBC and managed to check it’s functioning by using a few lines from a program I found online, but am drawing a blank with more coding. With no assembler, I’ve been trying to work out the op codes from the programming manuals etc. of which I have downloaded at least six. However, unllike all other processors I’ve used in the past, decoding the instructions into the op codes is defying me! (I managed it with the 68000 with no worries) but this Z8000 is like double Dutch to me. Maybe someone else has tried this OR does anyone know of an assembler that will handle the Z8000 devices? I did manage to find an old DOS assembler, but when loading it up on an old XP computer, it didn’t work 🙁 Can anyone help please?

.

Reply 1 of 2, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie

Over may career, I've had LOTS of experience with MANY different processor families and assenblers, and ASM remains one of my favorite ways to code.

When I built my first system in the 1970s, I coded by hand translating assembly into opcodes and entering the values in through a "monitor" program.

I later written assemblers, debuggers and C compilers for more than a dozen microprocessors, formed DDS and made a good living for many years selling and supporting them.

I've never looked at the Z8000 series however... I never liked ZILOG much, they became well known for the Z80 - and "expanded" Intel 8080.

One of the first assemblers I created was for the 8080 - it was pretty simple, with a 1<->1 match between instruction names and opcodes - so the Z80 should be easy right - just add a few extra instructions ... nope .... Zilog had changed to a many<->many match between instruction names and opcodes, based on operaand types and not in straightforward ways. This is why you saw many "Z80" assemblers which were essentially 8080 assenbkers with added instruction names for the extra Z80 functions.

I still have a lot of resources packed away, and may well have a Z8000 assembler somewhere ... I will take a look, but it will be a few weeks before I can do so. I'm currently on a ship (with bad internet and having to do this forumn on a phone - sorry for the many typoes).

--

If you have a DOS assembler that won't work on Win32 (which is off as Win32/XP is pretty DOS compatible - at least for my stuff) - have you looked at DosBox - I find it to emulate a very compativle DOS system ; while allowing direct access to files on the host - you coukd also use DosBox, PCem, 86box, VMware etc. to run actual DOS; but then you would have a "transfer" files to/from the host.

I also have a "universal assembler" which I wrote back in the day to more easily create an assembler for a "new" processor - It's also DOS based, and I don't know how useful it might be for the Z8000....

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 2 of 2, by bakemono

User metadata
Rank Oldbie
Rank
Oldbie

There was a thread about this on vcfed but I can't find it right now. Instruction encoding on Z8000 is generally not too complicated. You have a 16-bit opcode word, usually with operands encoded in bits 0~3 and 4~7. If the operand is a register, then the register number goes in that corresponding nibble in the opcode. In the case of a register pair (32 bits), you only use even numbers. If it's a memory operand, then the nibble is 0 when there's only an address, or some other number when there is an index register that is added to the address. (R0 isn't used as an index register.) Some instructions have three operands, or an addressing mode with two registers added together, and those have a second opcode word (sort of like the extension word on 68000).

You also have to know whether you're in 'non-segmented' or 'segmented' mode. In the former, you only have 16-bit addresses. In 'segmented' mode, register-indirect addressing uses a 32-bit register pair instead of a 16-bit register, and address operands can be 16 or 32 bits:

a full segmented address has bit 15 of the segment word set, bits 8~14 are the segment, and bits 0~7 unused
(and a 16-bit offset word follows)

a short segmented address has bit 15 clear, bits 8~14 are the segment, and bits 0~7 are the offset

GBAJAM 2024 submission on itch: https://90soft90.itch.io/wreckage