Page 1 of 1

IDE Mark section as inline assembly (just as with a comment)

Posted: Mon Mar 20, 2006 2:45 pm
by Trond
Wish: A way to select a large block of text and insert a ! at the start of every line.

Posted: Mon Mar 20, 2006 2:59 pm
by freak
In what situation would this be usefull ?

Posted: Mon Mar 20, 2006 3:21 pm
by Trond
If I want to test if this code works:

Code: Select all

    IntToStr:
        ; eax = number, ebx = base, edi = buffer
        push    ecx edx
        xor     ecx,ecx
      .new:
        xor     edx,edx
        div     ebx
        push    edx
        inc     ecx
        test    eax,eax
        jnz     .new
      .loop:
        pop     eax
        add     al,30h
        cmp     al,'9'
        jng     .ok
        add     al,7
      .ok:
        stosb
        loop    .loop
        mov     al,0
        stosb
        pop     edx ecx
        ret
I would have to add an ! in front of every line. (It does work.)

Posted: Fri Mar 24, 2006 2:10 pm
by techjunkie
UltraEdit has this feature. :D

I think a macro-language in the IDE would be a better solution (UltraEdit has this too).

Posted: Fri Mar 24, 2006 2:12 pm
by PB
Enabling inline ASM does that, without the need to put ! on each line.

Posted: Fri Mar 24, 2006 2:23 pm
by Trond
PB wrote:Enabling inline ASM does that, without the need to put ! on each line.
No it doesn't.

Inline asm has a different syntax because I can directly use variables and pointers as operands.

Inline asm doesn't support local labels (used in the code above).

Inline asm doesn't support the stosb mnemonic.

Inline asm turns all the asm keywords into uppercase (which I don't want).

Inline asm makes it inpossible to use asm keywords as PB variables.

Inline asm messes up the case of all PB variables starting with an asm keyword (like: turning Popsicle into POPsicle, etc...).

Hightlighting is wrong after asm keywords when using inline asm feature instead of !'s. (PB keywords highlighted in asm lines.)

Inline asm highlights asm mnemonics which are also PB keywords as PB keywords. (I.e. XOr edx,edx where XOr looks like a PB keyword.)

Posted: Fri Mar 24, 2006 2:44 pm
by PB
@Trond: You certainly do your homework. :)

And you know, if you gave some of these reasons in the first place, you could
avoid us giving you "useless" advice and tips, because we don't know your
reasons until you always go ahead and correct us afterwards. ;)

Posted: Fri Mar 24, 2006 6:04 pm
by freak
Inline asm messes up the case of all PB variables starting with an asm keyword (like: turning Popsicle into POPsicle, etc...).

Inline asm highlights asm mnemonics which are also PB keywords as PB keywords. (I.e. XOr edx,edx where XOr looks like a PB keyword.)
Those two are changed for the next beta.

As for the request. It is probably something that will be used rather rarely,
and i do not want to overload the IDE with features that are rarely used.
You can easily add this functionality through an external tool though, thats
what the tools-interface was created for.

Posted: Wed Mar 29, 2006 9:31 pm
by Trond
It's the same problem with the case changing of constants.

Posted: Tue Apr 04, 2006 11:13 am
by Trond
I also forgot to say that when I turn on inline asm the whole ide quite often crashes. Just type some asm inside a procedure, fold it, enable inline asm in the compiler options and kaboom.