' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- ID "template" DEVICE SX28, OSCXT2, BOR42 FREQ 20_000_000 ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- myArray VAR Byte (4) tmpB1 VAR Byte tmpB2 VAR Byte tmpB3 VAR Byte tmpB4 VAR Byte tmpB5 VAR Byte ' ========================================================================= ' declares ' ========================================================================= LoadArray SUB 1, 1 ' ========================================================================= PROGRAM Start ' ========================================================================= Start: LoadArray @myArray END ' ------------------------------------------------------------------------- ' Subroutine / Function / Task Code ' ------------------------------------------------------------------------- ' Use: LoadArray @array SUB LoadArray pntr VAR tmpB1 b1 VAR tmpB2 ' working vars b2 VAR tmpB3 b3 VAR tmpB4 b4 VAR tmpB5 b1 = 11 ' plug in random values b2 = 99 b3 = 91 b4 = 10 __RAM(pntr) = b1 ' move to array INC pntr __RAM(pntr) = b2 INC pntr __RAM(pntr) = b3 INC pntr __RAM(pntr) = b4 ENDSUB