mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-31 04:50:37 +00:00
implement immediate argument for call
This commit is contained in:
parent
ed98f65d10
commit
b7eae0dca5
1 changed files with 21 additions and 11 deletions
|
@ -811,9 +811,11 @@ static void emit_call(const char* mnemonic, arg_t arg1, arg_t arg2, void* data)
|
|||
{
|
||||
u8 rex, modrm, sib;
|
||||
|
||||
if(arg1.type != T_REGISTER || arg2.type != T_NONE)
|
||||
if((arg1.type != T_REGISTER && arg1.type != T_IMMEDIATE) || arg2.type != T_NONE)
|
||||
CRAP_INVALID_ARGS;
|
||||
|
||||
if(arg1.type == T_REGISTER)
|
||||
{
|
||||
if(!arg1.absolute)
|
||||
crap("call must be absolute");
|
||||
|
||||
|
@ -830,6 +832,14 @@ static void emit_call(const char* mnemonic, arg_t arg1, arg_t arg2, void* data)
|
|||
emit1(0xff);
|
||||
emit1(modrm);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isu32(arg1.v.imm))
|
||||
crap("must be 32bit argument");
|
||||
emit1(0xe8);
|
||||
emit4(arg1.v.imm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void emit_twobyte(const char* mnemonic, arg_t arg1, arg_t arg2, void* data)
|
||||
|
|
Loading…
Reference in a new issue