Herbert Oppmann 13-MAR-94 Documentation for M80 V3.44 09-Dec-81 Opcodes and Pseudo-Ops ---------------------- Table at 05CCh, sorted by alphabet, contains separate sub-tables for each of the possible first characters (a-z, '.', '$'), each terminated by a zero byte. The first char is not recorded. To speed up the access there is a table at 0598h which contains 26 pointers corresponding to the 26 possible letters that the first char of the (pseudo-)opcode can be. The pointers for '.' and '$' are not in that table but hard-coded in the search routine. The subtable of '.' begins at 0948h, the subtable of '$' begins at 09D0h. Each entry consists of two syntax bytes followed by the variable- length text of the (pseudo-)opcode without the first char. First syntax byte: +---+---+---+---+---+---+---+---+ ! 7 ! 6 5 4 3 ! 2 1 0 ! +---+---+---+---+---+---+---+---+ ^ ^ ^ ! (*) ! 0= normal opcode length of text 1= pseudo-op The meaning of the (*) value depends on whether it is a normal opcode or a pseudo-op. Pseudo-opcode: second syntax byte is used as an index in the JMPTBL (at 0A06h), the entry found there is a pointer to a handling routine for that pseudo-op. Normal opcode: if (*) is greater or equal 1010b (10 decimal) then it is a Z80 opcode, else a 8080 opcode. (*) is used as an index in FLOCTL (at 09E8h), the entry found there is a pointer to a routine that uses the second syntax byte and additional input to generate the desired code. value of (*) generated code -------------------------------------------------- (8080) 0 s2 1 s2 + 8 * 2 s2 + 8 * 3 s2 + 4 s2 + 8 * 5 s2, n 6 s2, nn 7 s2 + 8 * + except M,M 8 s2 + 8 * , n 9 s2 + 8 * , nn (Z80) A -- \ further proceedings B 0CBh | see below # C 0EDh / D same as 0 E 0EDh, s2 F not used s2 means the second syntax byte n means a 8 bit constant nn means a 16 bit constant <..,..,..> means possible arguments, which are coded as numbers for that calculation using the following values: B = 0, C = 1, D = 2, E = 3, H = 4, L = 5, M = 6, A = 7, SP = 6. #: s2 is added to XTBL (at 0A84h). Two bytes x1 and x2 are read from there. x2 is the basis of the opcode, x1 is used as index in XJPTBL (at 0AC6h). value of x1 generated code -------------------------------------------------- 0 2 4 .. [here is where I stopped my research]