Mercurial > hg > CbC > old > device
diff mc-code-ia32.c @ 166:9e55cc5551fb
*** empty log message ***
author | kono |
---|---|
date | Mon, 24 Nov 2003 13:09:14 +0900 |
parents | 6409ff6bc219 |
children | 0197ca125567 |
line wrap: on
line diff
--- a/mc-code-ia32.c Mon Nov 24 10:42:03 2003 +0900 +++ b/mc-code-ia32.c Mon Nov 24 13:09:14 2003 +0900 @@ -543,7 +543,7 @@ printf("\tmovl %s,%s\n",((NMTBL*)cadr(e1))->nm,register_name(creg,0)); regv[creg]=1; } -static char *cload(int sign,int sz) { return sz==1?(sign?"movsbl":"movbl"):sz==size_of_short?(sign?"movswl":"movwl"):"movl"; } +static char *cload(int sign,int sz) { return sz==1?(sign?"movsbl":"movzbl"):sz==size_of_short?(sign?"movswl":"movzwl"):"movl"; } void code_crgvar(int e1,int creg,int sign,int sz){ printf("\t%s %s,%s\n",cload(sign,sz), @@ -694,7 +694,7 @@ return; } g_expr(e2); - printf("\t%s (%s),%s\n",sign?"movsbl":"movbl",register_name(creg,0),register_name(creg,0)); + printf("\t%s (%s),%s\n",sign?"movsbl":"movzbl",register_name(creg,0),register_name(creg,0)); printf("\tsubl $%d,(%s)\n",sz,register_name(creg,0)); } @@ -1108,12 +1108,16 @@ break; case CRINDIRECT: byte = 1; op="movsbl";t=CHAR; + break; case CURINDIRECT: - byte = 1; op="movbl";t=UCHAR; + byte = 1; op="movzbl";t=UCHAR; + break; case SRINDIRECT: byte = 1; op="movswl";t=SHORT; + break; case SURINDIRECT: - byte = 1; op="movwl";t=USHORT; + byte = 1; op="movzwl";t=USHORT; + break; case RINDIRECT: default: byte = 0; op="movl";t=INT; } @@ -1323,7 +1327,7 @@ { char *op; - op = byte ? (sign?"movsbl":"movbl") : "movl"; + op = byte ? (sign?"movsbl":"movzbl") : "movl"; if (n) printf("\t%s %d(%s),%s\n",op,n, register_name(xreg,0),register_name(creg,byte));