scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

z80.c (902B)


      1 static char sccsid[] = "@(#) ./as/target/x80/z80.c";
      2 
      3 #include <stdlib.h>
      4 
      5 #include <scc/scc.h>
      6 
      7 #include "../../as.h"
      8 #include "../x80/proc.h"
      9 
     10 TUINT maxaddr = 0xFFFFFFFF;
     11 int endian = LITTLE_ENDIAN;
     12 
     13 void
     14 iarch(void)
     15 {
     16 	static struct {
     17 		char *name;
     18 		char type;
     19 	} regs[] = {
     20 		"AF", AREG_AF,
     21 		"A", AREG_A,
     22 		"F", AREG_F,
     23 
     24 		"BC", AREG_BC,
     25 		"B", AREG_B,
     26 		"C", AREG_C,
     27 
     28 		"HL", AREG_HL,
     29 		"H", AREG_H,
     30 		"L", AREG_L,
     31 
     32 		"DE", AREG_DE,
     33 		"D", AREG_D,
     34 		"E", AREG_E,
     35 
     36 		"IX", AREG_IX,
     37 		"IXL", AREG_IXL,
     38 		"IXH", AREG_IXH,
     39 
     40 		"IY", AREG_IY,
     41 		"IYL", AREG_IYL,
     42 		"IYH", AREG_IYH,
     43 
     44 		"R", AREG_R,
     45 		"I", AREG_I,
     46 		"AF'", AREG_AF_,
     47 		"SP", AREG_SP,
     48 
     49 		"NZ", AREG_NZ,
     50 		"Z", AREG_Z,
     51 		"NC", AREG_NC,
     52 		"PO", AREG_PO,
     53 		"PE", AREG_PE,
     54 		"P", AREG_P,
     55 		"M", AREG_M,
     56 
     57 		NULL,
     58 	}, *bp;
     59 
     60 	for (bp = regs; bp->name; ++bp) {
     61 		Symbol *sym = lookup(bp->name);
     62 		sym->flags = FREG;
     63 		sym->value = bp->type;
     64 	}
     65 }