English
Source / code snippets

Assembler Reverse Spiegeln String

 

CompileMarkSeparation
 {$cleq}
Declare s$
Cls
s$="TEST THE FASTEST XPROFAN"
print s$+"."
print rstr$(s$)+"."
Waitkey
End

proc rstr$

    parameters s$
    declare ss$
    ss$:=s$+" "

    AsmStart _rstr

        Parameters addr(s$),len(s$),addr(ss$)
        .data
        cw dd 0
        .code
        mov eax,para1
        mov ebx,para2
        mov ecx,para3
        mov cw,ebx
        mov edx,0

        .while edx<ebx

            dec cw
            push ebx
            push edx
            mov edx,cw
            mov bl,[ecx+edx]
            pop edx
            mov [eax+edx],bl
            pop ebx
            inc edx

        .endw

    AsmEnd

    return s$

endproc

or nichtasm:
CompileMarkSeparation
PRFellow-Presentation
Author: Thomas Hölzer
a String of hinten to in front sweep
Declare strbuf#

Proc ReverseString

    Parameters s$
    Declare l%,result$
    Let l%=Len(s$)
    Dim strbuf#,Add(l%,1)
    String strbuf#,0=s$
    Dec l%

    While Gt(l%,-1)

        Let result$=result$;Char$(strbuf#,l%,1)
        Dec l%

    Wend

    Dispose strbuf#
    Return result$

ENDPROC

example
Cls
Declare n&
n&=&gettickcount
ReverseString MkStr$($Syspath + $Winpath,100)
print (&gettickcount - n&) / 1000,Len(MkStr$($Syspath + $Winpath,100))
WaitInput
or of M.Dell
CompileMarkSeparation
Proc ReverseStr

    Parameters RS_ES$
    Declare RS_AS$

    WhileLoop Len(RS_ES$),1,-1

        RS_AS$ = (RS_AS$ + Mid$(RS_ES$,&Loop,1))

    EndWhile

    Return RS_AS$

ENDPROC

**** example ****
Cls
Print "Orginaltext: Beispielstring"
Print
Print "Reverstext:  " + ReverseStr("Beispielstring")
WaitInput
End
salvo, iF.
 
09/24/05  
 




Michael
Wodrich
or your ASM-Version without Hilfsstring and Datenbereich
CompileMarkSeparation
 {$Cleq}
Declare S$
Cls
S$="TEST THE FASTEST XPROFAN"
Print S$+"."
Print ReverseString$(S$)+"."
Waitkey
End

Proc ReverseString$

    Parameters s$

    AsmStart _rstr

        Parameters Addr(s$), Len(s$)
        mov ebx,para1
        mov ecx,para2
        mov edx,para1
        add edx,ecx
        dec edx

        .while edx > ebx

            mov al,[ebx]
            xchg al,[edx]
            mov [ebx],al
            inc ebx
            dec edx

        .endw

    AsmEnd

    Return s$

ENDPROC

 
Programmieren, das spannendste Detektivspiel der Welt.
09/24/05  
 




Frank
Abbing
Or minimale Asm-Version:
CompileMarkSeparation
 {$iq}
Declare text$
Declare dummy$
text$="Hier steht nur ein Probetext."
dummy$=Space$(Len(text$))

AsmStart Reverse

    Parameters addr(text$),addr(dummy$)
    invoke revstr,para1,para2

AsmEnd

text$=dummy$
Print text$
09/24/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.429 Views

Untitledvor 0 min.
H.Brill10/08/22
p.specht02/02/22
Sven Bader08/15/21
funkheld12/15/13
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie