base:quicksort_16-bit_elements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
base:quicksort_16-bit_elements [2016-08-18 12:20] – litwr2 | base:quicksort_16-bit_elements [2020-10-20 18:53] (current) – a link added litwr2 | ||
---|---|---|---|
Line 2: | Line 2: | ||
by Vladimir Lidovski aka litwr, 13 Aug 2016 (with help of BigEd) | by Vladimir Lidovski aka litwr, 13 Aug 2016 (with help of BigEd) | ||
- | It is well known that the best, the fastest sort routine is Quicksort. | + | It is well known that the best, the fastest sort routine is Quicksort. |
The next Pascal code was translated to 6502 assembler. | The next Pascal code was translated to 6502 assembler. | ||
Line 61: | Line 61: | ||
tya | tya | ||
adc i2hi | adc i2hi | ||
- | | + | |
sta zp1hi | sta zp1hi | ||
ror zp1lo | ror zp1lo | ||
Line 251: | Line 251: | ||
qs_csp | qs_csp | ||
- | dex | ||
- | dex | ||
txs | txs | ||
Line 263: | Line 261: | ||
lda #<array | lda #<array | ||
sta lblo | sta lblo | ||
+ | tsx | ||
+ | stx qs_csp+1 | ||
qsok lda lblo | qsok lda lblo | ||
sta i2lo | sta i2lo | ||
Line 277: | Line 277: | ||
tya | tya | ||
adc i2hi | adc i2hi | ||
- | | + | |
sta zp1hi | sta zp1hi | ||
ror zp1lo | ror zp1lo | ||
Line 395: | Line 395: | ||
</ | </ | ||
- | The locations //m3hi//, //m3lo//, //m4hi//, //m4lo// maybe situated anywhere in RAM. The invocation | + | The locations //m3hi//, //m3lo//, //m4hi//, //m4lo// maybe situated anywhere in RAM. The invocation |
- | < | + | |
- | tsx | + | |
- | stx qs_csp+1 | + | |
- | jsr quicksort | + | |
- | </ | + | |
- | + | ||
- | It is required to put the proper constants after // | + | |
+ | The other published 6502 Quicksort is at [[http:// |
base/quicksort_16-bit_elements.1471515624.txt.gz · Last modified: 2016-08-18 12:20 by litwr2