News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

anyone did inline asm and compiled with turbo c compiler?

Started by ggmasm32, December 19, 2015, 06:04:13 AM

Previous topic - Next topic

ggmasm32

because of the earlier requirement I posted here ( mixing c and asm) now I need to compile all my C files with tcc.
I currently have installed turbo C4 installed in my system.
I needed to put some inline assembly code at the same time and did several attempts after looking around online through mostly masm from msdn.

tried following variants, so far none of them works, so I am wondering if anyone has done in the past did this?
Does TCC support compiling inline asm code in C file? If so are syntax different than VS?

__asm__
(
    push eax
    pop  eax
);

__asm
{
    push eax
    pop  eax
};

jj2007

Why don't you try Pelles C? A great free compiler, and surely supports Masm32 syntax.

ACP

In Borland C++ or Turbo C you can use following syntax for short number of instrucitons:


asm mov ah,9
asm mov dx, offset msg
asm int 21h


For longer code it is better to use:


asm {
        mov ah,9
        mov dx, offset msg
        int 21h
}


You can also use semicolon to place multiple assembly language instruction in one line:


asm {
        push ax; push dx
        mov ah,9
        mov dx, offset msg
        int 21h
       pop dx; pop ax
}
ASM beyond Repair https://corexor.wordpress.com blog about assembly related stuff

BlueMR2

It's been forever since I've done that, but ACP's examples look about right.  :-)
My Code Site
https://github.com/BrianKnoblauch


BlueMR2

My Code Site
https://github.com/BrianKnoblauch

avcaballero

Ooops, in that case, you won't have a look to that   :P