[cc65] ca65 Z80 support

From: Gábor Lénárt <lgb1lgb.hu>
Date: 2005-12-04 14:40:16
Hello,

I've started to write support for the Z80 CPU into ca65 as I had spoken about
before. However I've got some problem because I have not full overview of the
internals of ca65. So it was trivial to add a new CPU type, and a new
instruction table, also one byte length opcodes are quite easy, after some
minutes it could assemble Z80 sources if you've commented out other opcodes.
However the problem is here. Let's see for example the following Z80 ops:

	RET
	RET Z
	JR label
	JR Z,label
	CALL label
	CALL Z,label

Ones with 'Z' are conditioned opcodes (Z is the condition here, other one
can stay here as well). At the level of CPU opcodes there are simply another
opcodes. Now how can I parse the source? I guess I should work with
scanner.c or such to have token for reserved words like Z, NZ, C, NC ...
(conditions) or Z80 registers itself, and I should not use tokenizer for
65xx specific ones, like A, X or Y. But I don't want to mess up the whole
source without asking first the "best" solution for the problem of support
of a totally different CPU from the already-well-supported 65xx ones int
ca65. Since Z80 differs from these CPUs a lot, I guess I've got quite big
change in tokenizer and such, and I don't want it, if you won't accept my
code because of its uglyness.

Thanks in advance,

-- 
- Gábor
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Dec 4 14:40:35 2005

This archive was generated by hypermail 2.1.8 : 2005-12-04 14:40:38 CET