In article <_9Ch…@violet.siamics.net>, Ivan Shmakov <iv…@siamics.netREMOVE.invalid> wrote: <SNIP>
> I mean, consider that you might want to adapt your as80.frt to > interoperate with an existing Z80 assembler, where the "PCHL" > instruction is spelled "JP (HL)". Is it something that could > be done with ciasdis?
No, that doesn't work. The post-it fixup principle demands i.a. that the mnemonic significant bits are known by a mask that identifies them. 0 0 0 T! 08 07 8 1FAMILY, RLC RRC RAL RAR DAA CMA STC CMC defines 07 0F 17 2F .. 4F. During disassembly you match as a whole byte, because of the 0 passed to T! More illustrative is the following. 00 00 38 T! 08 00 8 xFAMILY| B'| C'| D'| E'| H'| L'| M'| A'| ( dst) 01 04 2 1FAMILY, INR DCR ( B'|) For disassembling you erase the bits from 38 in the instruction you want to disassemble. ( That are the bits filled in by B'| C'| etc.) What is left, you match with the 04 05 of INR DCR. If there is a bit outside of the 38 e.g. 14 then INR or DCR is not a disassembly and you go on. Otherwise you continue with matching the "fixups" B'| etc. You cannot make this to work with an arbitrary prescribed assembler syntax. The advantage is that the assembler disassembler works for all processors. What remains is filling in tables. It is comparatively easy to add a table for more instructions like an SSE set. However filling in the tables has the difficulty that the instruction must be hit in the right order, and before the fixup. Groetjes Albert
-- The Chinese government is satisfied with its military superiority over USA. The next 5 year plan has as primary goal to advance life expectancy over 80 years, like Western Europe.