MemSort()

MemSort() sorts all Bytes of a memory block in ascending order (SRAM). Syntax: MemSort( sAdr as word, numBytes as word )

  • sAdr: Starting address of the memory block (SRAM).
  • numBytes: Number of Byte to sort.

Example

const F_CPU  = 20000000
avr.device	= atmega328p
avr.clock		= F_CPU
avr.stack		= 32
uart.baud		= 19200
uart.send.enable
uart.recv.enable
print 12;"MemSort() example"
dim i,a as byte
dim m as MemoryBlock
m.New(10)
m.PString(0)="76193."
print "before: ";34;m.PString(0);34
MemSort(m.Ptr+1,m.ByteValue(0))
print "after: ";34;m.PString(0);34 'output: "    .13679"
print
print "ready"
do
loop