Mercurial > hg > CbC > old > device
diff mc-code-ia32.c @ 196:5f70abd9453d
*** empty log message ***
author | kono |
---|---|
date | Wed, 07 Apr 2004 21:14:19 +0900 |
parents | c193120ee2a6 |
children | 28baf6cd9ad1 |
line wrap: on
line diff
--- a/mc-code-ia32.c Sun Apr 04 21:17:10 2004 +0900 +++ b/mc-code-ia32.c Wed Apr 07 21:14:19 2004 +0900 @@ -1085,38 +1085,57 @@ } int -rindirect(int e1) /* *(p +5 ) */ +code_rindirect(int e1, int offset, int us) +{ + char *crn,*op; + int byte; + g_expr(e1); + byte = 0; op="movl"; + crn = register_name(creg,0); + printf("\t%s %d(%s),%s\n",op,offset,crn,crn); + return us?UNSIGNED:INT; +} + +int +code_crindirect(int e1, int offset, int us) { - char *op; - int e2,e3,byte,t; - e3 = cadr(e2 = cadr(e1)); - g_expr(e2); - switch (car(e1)) { + char *crn,*op; + int byte; + g_expr(e1); + byte = 0; op=us?"movzbl":"movsbl"; + crn = register_name(creg,0); + printf("\t%s %d(%s),%s\n",op,offset,crn,crn); + return us?UCHAR:CHAR; +} + +int +code_srindirect(int e1, int offset, int us) +{ + char *crn,*op; + int byte; + g_expr(e1); + byte = 0; op=us?"movzwl":"movswl"; + crn = register_name(creg,0); + printf("\t%s %d(%s),%s\n",op,offset,crn,crn); + return us?USHORT:SHORT; +} + #if FLOAT_CODE - case FRINDIRECT: case DRINDIRECT: - printf("\t%s (%s)\n",fload(car(e1)==DRINDIRECT),register_name(creg,0)); - t=DOUBLE; - return t; - break; +int +code_drindirect(int e1, int offset, int d) +{ + g_expr(e1); + printf("\t%s (%s)\n",fload(d),register_name(creg,0)); + return DOUBLE; +} #endif - case CRINDIRECT: - byte = 1; op="movsbl";t=CHAR; - break; - case CURINDIRECT: - byte = 1; op="movzbl";t=UCHAR; - break; - case SRINDIRECT: - byte = 1; op="movswl";t=SHORT; - break; - case SURINDIRECT: - byte = 1; op="movzwl";t=USHORT; - break; - case RINDIRECT: default: - byte = 0; op="movl";t=INT; - } - printf("\t%s (%s),%s\n",op,register_name(creg,0),register_name(creg,0)); - return t; + +#if LONGLONG_CODE +int +code_lrindirect(int e1, int offset, int us) +{ } +#endif char * move(int byte)