On Mon, Dec 05, 2005 at 09:44:21AM +0100, Gábor Lénárt wrote: > I've started to code an EvalZ80() function which would parse > the rest of the line to get with the number of arguments (separated by > comma), and the type of them. Each handler would call this EvalZ80() first, > check number of params and types and then decide if it's valid and generate > code if so. I guess this is not it whould be done ;-) It works well for > instructions don't need any parameters (TokIsSep() can be used to detect > if have bogus params). However problem occures to write the real part of my > EvalZ80(). I would like to classify assembly source line (after opcode name > itself) in this way: Please have a look at the ea... modules. They are used to determine the addressing mode of an instruction and will fill a struct with the results. > Then handlers can use these MODE_ constants to check if addressing mode > is valid and if it is what code should be generated (probably in the form > of having an array contain every valid combination of these constants, > type byte(s) should emit and the optional variable stuff value and type > (signed byte, word)). Once the addressing mode is determined, it is easy to check if it is valid with a given instruction, since the table entry for the instruction contains a bit field that encodes the valid addressing modes. Regards Uz -- Ullrich von Bassewitz uz@musoftware.de ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.Received on Mon Dec 5 17:25:41 2005
This archive was generated by hypermail 2.1.8 : 2005-12-05 17:25:44 CET