c128lib Framework
A Commodore 128 software framework for enabling high-level development of C128 programs.
Loading...
Searching...
No Matches
sort-global.asm File Reference

Functions

macro c128lib_BubbleSort (indirizzoArray, dimensioneArray, switchToFastModeWhileRunning)
 Sort module.
 

Function Documentation

◆ c128lib_BubbleSort()

macro c128lib_BubbleSort ( indirizzoArray ,
dimensioneArray ,
switchToFastModeWhileRunning  )

Sort module.

Macros for array sorting.

Date
2023

This macro implements the Bubble Sort algorithm.

Parameters
[in,out]arrayAddressThe starting address of the array to be sorted.
[in]arraySizeThe size of the array to be sorted.
[in]switchToFastModeWhileRunningIf true, the macro will switch to 8502 fast mode.

This macro sorts an array in ascending order using the Bubble Sort algorithm. If 'switchToFastModeWhileRunning' is true, the macro will switch to 8502 fast mode while running. This can be beneficial for larger arrays.

Note
The sorted array is available at the same memory address as the input array. The macro modifies the .A, .X, and .Y registers. If you're using these registers elsewhere in your code, you'll need to save their values before calling this macro and restore them afterward.
Since
0.1.0