tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] lcall invalid hex code


From: Michael Matz
Subject: Re: [Tinycc-devel] lcall invalid hex code
Date: Tue, 3 May 2016 05:28:51 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)

Hi,
On Tue, 3 May 2016, Sergey Korshunoff wrote:

Fixed in mob, plus some more asm bugs (32 and 64 bit).

ALT(DEF_ASM_OP1(lcall, 0xff, 3, OPC_MODRM, OPT_EA))        1) or
ALT(DEF_ASM_OP1(lcall, 0xff, 3, OPC_MODRM, OPT_INDIR))    2) ?

The first one. Look at the handling of OPT_INDIR, it's a no-op in tccs sources. Note that OPT_INDIR can be or-ed with anything else, so OPT_EA|OPT_INDIR is also okay, though it won't change much.

A test code:
static unsigned long bios32_service(unsigned long service)
{
   int return_code;
   __asm__("lcall *(%%edi); cld"
       : "=a" (return_code)
       : "0" (service),
         "D" (&bios32_indirect));
   __asm__("lcall (%%edi); cld"
       : "=a" (return_code)
       : "0" (service),
         "D" (&bios32_indirect));
}

gcc/as prints warning for second case (indirect call w/o *). tcc with
1) accept all cases 2) don't accept second case (error:).

I looked at the "call" opcode 0xff modifiers
ALT(DEF_ASM_OP1(call, 0xff, 2, OPC_MODRM, OPT_INDIR))

That should be |OPT_EA as well I think.


Ciao,
Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]