' The compiler does not handle Byte or Word arrays larger than 256 elements directly ' Therefore use the Large Arrays macros ' ' For use with 18F devices only ' Device = 18F25K20 Xtal = 4 Declare Optimiser_Level = 1 Include "Large Arrays.inc" ' Add the large array macros to the program Warnings = Off ' Supress the warning about large arrays Dim wIndex As Word ' Create a variable for the arrays's wIndex Dim bAssignment As Byte ' Create a container variable ' ' Try to place arrays and strings at the end of the Dim list ' So that commonly used variables are less likely to require lots of RAM bank switching ' This will reduce code size and allow the program to run more efficiently ' Arrays and Strings are mostly accessed using indirect methods which require no RAM bank switching ' So they will not suffer from being in higher banks ' Dim MyArray[600] As Byte ' Create a very large byte array ' This could also be a large word array '------------------------------------------------------------------------ Main: ' ' Write to the large array ' For wIndex = 0 To 599 ' Create a loop for the size of the array WriteArray MyArray,[wIndex], wIndex ' Write values to the array Next ' Close the loop ' ' Read from the large array and display the results ' For wIndex = 0 To 599 ' Create a loop for the size of the array bAssignment = ReadArray MyArray,[wIndex] ' Read values from teh array HRSOut Dec bAssignment, "," DelayMS 10 ' A small delay Next ' Close the loop HRSOut 13 Stop