C_loi
$1 == 1 ==> "pop ecx";
- "movzx eax, (ecx)";
+ "movzxb eax, (ecx)";
"push eax".
$1 == 2 ==> "pop ecx";
- "xor eax,eax";
- "o16";
- "mov eax, (ecx)";
- "push (eax)".
+ "movzx eax, (ecx)";
+ "push eax".
$1 == 4 ==> "pop eax";
"push (eax)".
$1 == 2 ==> "pop eax";
"pop ecx";
- "o16";
- "mov (eax),ecx".
+ "movw (eax),ecx".
$1 == 4 ==> "pop eax";
"pop (eax)".
"add esp,8".
default ==> arg_error("C_dvf", $1).
+C_ngf
+ $1 == 4 ==> "call .ngf4".
+ $1 == 8 ==> "call .ngf8".
+ default ==> arg_error("C_ngf", $1).
+
C_fif
$1 == 4 ==> C_lor((arith)1);
"call .fif4";
"sub eax,4";
"push eax";
"call .fef4".
- $1 == 8 ==> "mov eax,esp"
+ $1 == 8 ==> "mov eax,esp";
"sub eax,4";
"push eax";
"call .fef8".
C_prolog ==> .
C_locals
- $1 < 32767 ==> "enter $1,0".
- default ==> "enter 0,0";
+ ==> "push ebp";
+ "mov ebp,esp";
"sub esp, $1".
EMHOME = ../../..
CEG = $(EMHOME)/lib/ceg/util
-VERSION = make_obj
+OBJ = obj
all:
- make -f $(CEG)/$(VERSION)
+ make -f $(CEG)/make_asobj "OBJ="$(OBJ)
install:
- make -f $(CEG)/$(VERSION) install
+ make -f $(CEG)/make_asobj "OBJ="$(OBJ) install
cmp:
- -make -f $(CEG)/$(VERSION) cmp
+ -make -f $(CEG)/make_asobj "OBJ="$(OBJ) cmp
pr:
@pr Makefile EM_table mach.h mach.c as_table as.h as.c
# total cleanup
clean:
- make -f $(CEG)/$(VERSION) clean
+ make -f $(CEG)/make_asobj "OBJ="$(OBJ) clean
# only remove ce, ceg, and back directories
dclean:
- make -f $(CEG)/$(VERSION) dclean
+ make -f $(CEG)/make_asobj "OBJ="$(OBJ) dclean
* expr(reg) -> IS_MEM
*/
{
- char *ptr, *index();
+ char *ptr, *strindex();
op->type = UNKNOWN;
if ( *last( str) == RIGHT) {
- ptr = index( str, LEFT);
+ ptr = strindex( str, LEFT);
*last( str) = '\0';
*ptr = '\0';
if ( is_reg( ptr+1, op)) {
char *str;
struct t_operand *op;
{
- char *ptr, *index(), *sprint();
+ char *ptr, *strindex(), *sprint();
static char buf[256];
- ptr = index( str, '+');
+ ptr = strindex( str, '+');
if ( ptr == 0)
op->off = "0";
}
else {
op->type = IS_LABEL;
- if ( index( str, DOLLAR) != 0)
+ if ( strindex( str, DOLLAR) != 0)
op->lab = str;
else
op->lab = sprint( buf, "\"%s\"", str);
@text1(%$(src->expr));
@else
@text1(%d(opc));
- @text1(%$(src->expr));
+ @text4(%$(src->expr));
@fi
}
}
@else
@text1(%d(opc));
mod_RM(reg, dst);
- @text1(%$(src->expr));
+ @text4(%$(src->expr));
@fi
}
}
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x12);
+ @text1(0x82);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
je dst:ILB ==> @text1( 0x74);
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x14);
+ @text1(0x84);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
jg dst:ILB ==> @text1( 0x7f);
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x1f);
+ @text1(0x8f);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
jge dst:ILB ==> @text1( 0x7d);
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x1d);
+ @text1(0x8d);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
jl dst:ILB ==> @text1( 0x7c);
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x1c);
+ @text1(0x8c);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
jle dst:ILB ==> @text1( 0x7e);
@text1( %dist( dst->lab)).
... dst:lABEL ==> @text1(0x0f);
- @text1(0x1e);
+ @text1(0x8e);
@reloc4( %$(dst->lab), %$(dst->off), PC_REL).
jmp dst:ILB ==> @text1( 0xeb);
mod_RM( 0, dst);
@reloc4( %$(src->lab), %$(src->off), ABSOLUTE).
+movw dst:EADDR, src:REG ==> @text1( 0x66); /* operand size prefix */
+ @text1( 0x89);
+ mod_RM( src->reg, dst).
+
movb dst:EADDR, src:REG ==> @text1( 0x88);
mod_RM( src->reg, dst).
+movzxb dst:REG, src:EADDR ==> @text1(0x0f);
+ @text1(0xb6);
+ mod_RM(dst->reg, src).
+
movzx dst:REG, src:EADDR ==> @text1(0x0f);
@text1(0xb7);
mod_RM(dst->reg, src).
not dst:EADDR ==> @text1( 0xf7);
mod_RM( 2, dst).
-o16 ==> @text1(0x66).
-
or dst:REG, src:EADDR ==> @text1( 0x0b);
mod_RM( dst->reg, src).
... src:DATA ==> small_const(0x68, src).
-... src:lABEL ==> @emit1(0x68);
+... src:lABEL ==> @text1(0x68);
@reloc4(%$(src->lab), %$(src->off), ABSOLUTE).
... src:EADDR ==> @text1( 0xff);