scc

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

i286.c (759B)


      1 static char sccsid[] = "@(#) ./as/target/x86/i286.c";
      2 
      3 #include <scc/scc.h>
      4 
      5 #include "../../as.h"
      6 #include "../x86/proc.h"
      7 
      8 TUINT maxaddr = 0xFFFF;
      9 int endian = LITTLE_ENDIAN;
     10 int left2right = 0;
     11 
     12 void
     13 iarch(void)
     14 {
     15 	static struct {
     16 		char *name;
     17 		char type;
     18 	} regs[] = {
     19 		"CS", AREG_CS,
     20 		"DS", AREG_DS,
     21 		"SS", AREG_SS,
     22 		"ES", AREG_ES,
     23 
     24 		"AX", AREG_AX,
     25 		"AL", AREG_AL,
     26 		"AH", AREG_AH,
     27 
     28 		"BX", AREG_BX,
     29 		"BL", AREG_BL,
     30 		"BH", AREG_BH,
     31 
     32 		"CX", AREG_CX,
     33 		"CL", AREG_CL,
     34 		"CH", AREG_CH,
     35 
     36 		"DX", AREG_DX,
     37 		"DL", AREG_DL,
     38 		"DH", AREG_DH,
     39 
     40 		"SI", AREG_SI,
     41 		"DI", AREG_DI,
     42 
     43 		"SP", AREG_SP,
     44 		"BP", AREG_BP,
     45 
     46 		NULL
     47 	}, *bp;
     48 
     49 	for (bp = regs; bp->name; ++bp) {
     50 		Symbol *sym = lookup(bp->name);
     51 		sym->flags = FREG;
     52 		sym->value = bp->type;
     53 	}
     54 }