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

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

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

Post by Trond »

Wish: A way to select a large block of text and insert a ! at the start of every line.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

In what situation would this be usefull ?
quidquid Latine dictum sit altum videtur
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.)
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

UltraEdit has this feature. :D

I think a macro-language in the IDE would be a better solution (UltraEdit has this too).
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Enabling inline ASM does that, without the need to put ! on each line.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

It's the same problem with the case changing of constants.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
Post Reply