What if I told you I can't write a C++ template, but can program games using a Sharp chip, and Gameboy mobo?

Pages: 12
What are examples of machines its used in?
*nix x64
Ew, x86-64 is horrible. Better than x86 but still horrible. Start with 6502 or ARM, they're much simpler and much nicer.
Is it possible to integrate ASM with C++ or C?
yes, using the keyword asm
Some compilers support the nonstandard language extension of in-code ASM blocks. For VC++, it's
__asm { /*asm here*/ } - you'll have to see what it is for other compilers.
Last edited on
Is that a defined function?
1
2
3
4
5
6
7
8
9
10
11
void f()
{
    code;

    __asm
    {
        asm code
    }

    code;
}
Like I said, it is non-standard and not the same for all compilers. Use it only if you have no alternative.
If I uses ASM in my code, will it still be portable to other processors?
I was going to say that the asm keyword is standard, but, wow, I've never seen this Microsoft gem"
MSDN wrote:
Visual C++ support for the Standard C++ asm keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an asm block will not generate any meaningful code.

http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx

@Fredbill30
No, that's the whole point of assembly. You can write a few versions of the same routine for each of the supported platforms, though (e.g. boost.context is being done that way)
Last edited on
Registered users can post here. Sign in or register to post.
Pages: 12