A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4751

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

Re: Bubblesort - mcpaste

Re: Bubblesort

Von anonymous, 3 Jahre vorher, geschrieben in ARM Assembler, aufgerufen 782 mal. Dieser Paste ist eine Antwort auf Bubblesort von MC_J - zurück
URL https://mcpaste.de/view/a6157cb0/diff Einbetten
Unterschiede zwischen Bubblesort und Re: Bubblesort
# this subroutine bubble sorts vectors of words
#
# inputs
#   r0 - start of vector
#   r1 - number of elements to sort
#
# no outputs
#
# locals
#   r4 - current pointer
#   r5 - inner counter
#   r6 - keep_going flag
#   r7 - first element
#   r8 - second element

.equ datum_size,4
.globl _bubble
.text
_bubble:
        stmfd        sp!, {r4, r5, r6, r7, r8, lr}        @ save variables to stack
        cmp        r1, #1                                @ number of elements must be > 1
        ble        end_outer                        @ stop if nothing to do

        sub        r5, r1, #1                        @ need n-1 comparisons
        mov        r4, r0                                @ initialise current pointer
        mov        r6, #0                                @ this register set when we swap

loop_start:
        ldr        r7, [r4], #datum_size                @ load one element
        ldr        r8, [r4]                        @ and next one
        cmp        r7, r8                                @ compare them
        ble        no_swap                                @ branch if second greater

        mov        r6, #1                                @ set keep_going flag
        sub        r4, r4, #datum_size                @ reset pointer to first element
        swp        r8, r8, [r4]                        @ exchange value in r8 and address in r4
        str        r8, [r4, #datum_size]!                @ store new r8 to incremented address
no_swap:
        subs        r5, r5, #1                        @ decrement counter
        bne        loop_start                        @ and restart loop if more needed

end_inner:
        cmp        r6, #0                                @ check keep_going flag
        beq        end_outer                        @ and leave if not set

        mov        r6, #0                                @ clear keep_going flag 
        mov        r4, r0                                @ reset pointer
        sub     r5, r1, #1                        @ reset counter
        b        loop_start                        @ start another iteration

end_outer:
        ldmfd   sp!, {r4, r5, r6, r7, r8, pc}        @ restore state from stack and leave subroutime
U2FsdGVkX1/PS+f7Bee/UTfhcI3lnvDLZVmGy7rgKhvv8bGY4xlmooXVL1reypE5VqsZRC0edpgpZw5OyUg1oWvLzlcdJgekC35K
u7b4RzUyh+qArKIj1YP+ph9wLFUHvV5NZSZRUfpYe4wXIBcCrWjMXqwqoLJ6ZRUMm2uUqy6xQPOMGR7sMvRtIneVVq79sHlZiHlg
dEeealjGh5hlwvXza+dU4twrkxbVcJ5DjPevG5NVElabFPBb5w5r+iGokAixfNS/dgyGXiX/tISZWBqzrLwGFaTo1a4ECHXryRmJ
Gi6B7hKjfnzFnYIOYSdCkjoKK4a+wnq0FwyA3VgmDweNkjcjqqjB2ISuITs0xr24AVvygmOjRQ1EXWRVfjfll/XuMhMTrdUqf/bM
PXaXTMoA3R3jC5gBfNjsVEzG5m3rTvGaxdE8lELOm8BvJAwijlc/G8YU9gikykihNEkcWjTqGqqxwC5OF5yjnc7JCR4uPnpJT7pw
jiuiOf1hI6ddBRwx9o/qmJdJmJnNAgz6MpVsOdMNmAZ43F+w5kWfzEvIY1R2yjbi8tblJYlPZM4EJMi9K6FURYHENryFO8/vPwKQ
Kd0M4SZTYs3/7YhyHLoFPzPcu4IoHlb1i5gAa1Fca3BdCYZwrjM8z1nqgXb1eQSj2/BcmcOybvntJzlKtidoM+ajr4ZBjC9COYUU
WZdZV+j+bXwbQ7P4Tf6TlTxf1xn2Oa2IMb6MElI2Tl2UPJIQa5prtzfWlIU43gZZmD31MZyxAD7kJ2dwBDu0Co8Lbz77kLoL/swb
GQSVuL8YaSaOQ/gGaQwivSKQTj48T7SVly2NbBvqH9GJTPBCza1E6ZOJj4T5W6a1/HWCOthWLdES0RiuUQgBaFaBRAC6ZASLNZgX
Kk1ZU2s0aTXypUOYOk/6k9N6bjoDeMcC3RNGKm5wHd7lbWbk1RhS59EmpACUF+Pywy/cYmANlM0h111hlAjciBsu6wcNT5mmeRae
UbxvuiE4lLvLSkvrqpNK1BhRuypLR0/hCSsIjQ/3i9h0qMuyBK8NUBd8RKxqiI/AbBeMwAX+aMay6He0jRe4RK4oxaoxCvHQbQv7
L6rjYhfXCVje/1Fzza4Lg6yt2e9o2cDzLSs6vVZqqg0JPHwQjk2L6kSHn4RqDUrflwgkcr0NyhpEOUgtI16GO2I42rm4KkhU6pmi
YemmLnH6v/cnrQC9JkgwRxRAkLqJXTG19Dg8ns568q/AUAE2UUAViLOwaRwl/VmWRuuEG7QZnanuf5C1SeRdwgR+ApwBlk/8gGiA
Hf3mjYHlQjcP9og7rMTIuf92VkRGHwwuXAO/Ry1q8i+b4tU65w/pboTPQzwFJLsxAYkL7sgc2dfgKbGfy26hx3NdADwSlPTQgM3x
SRnIMyNmhguTGgIM26djuzWm5VPDNJRGTxPwxynJ8M52mU0r/DoEo8CO+4GmbG4LA7tO+7D1JbVdIf7xuz1AT6vH78PsnN/0XHWr
ABXC15esBxEiTDrEbCXySdV5HUDaCOIJgNgud1y2Wh3+buTviTiHGWXqIkJ7ZUZTOzxJclvjnd/Pd9g=

Antwort auf "Re: Bubblesort"

Hier kannst Du auf den Paste von oben antworten

captcha

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876