When the compiler searches and does not see me address the array by using @ArrayName, it removed the array to try to optimize.
Here is an example of some object that are in my code. This is actually managed outside of MikroBasic by a project editor.
Code: Select all
' Menu Name:'MainMenu'
' Title: 'Main Menu'
' Address: 1992
' Menu Items. Count:10
' Type Label Pointer CMD P1 P2
' =========================================================
' 3 'Reset Fuel' 320
' 0 'Settings' 2164
' 0 'Calibration' 2236
' 0 'Maintenance' 2190
' 3 'Test Menu Item X' 108
' 3 'Test Menu Item Y' 164
' 3 'Test Menu Item Z' 156
' 4 'LED On' 1 1 10000
' 4 'LED Off' 1 0 0
' 4 'Toggle LED' 2 0 0
CONST MainMenu as BYTE[172]=(
$01,$4D,$61,$69,$6E,$20,$4D,$65,$6E,$75,$00,$0A,$03,$52,$65,$73,$65,$74,$20,$46,$75,$65,$6C,$00,$40,$01,$00,$53,$65,$74,$74,$69,$6E,$67,$73,$00,$3A,$04,$00,$43,$61,$6C,$69,$62,$72,$61,$74,$69,$6F,$6E,$00,$5E,$04,$00,$4D,$61,$69,$6E,$74,$65,$6E,$61,$6E,$63,$65,$00,$47,$04,$03,$54,$65,$73,$74,$20,$4D,$65,$6E,$75,$20,$49,
$74,$65,$6D,$20,$58,$00,$6C,$00,$03,$54,$65,$73,$74,$20,$4D,$65,$6E,$75,$20,$49,$74,$65,$6D,$20,$59,$00,$A4,$00,$03,$54,$65,$73,$74,$20,$4D,$65,$6E,$75,$20,$49,$74,$65,$6D,$20,$5A,$00,$9C,$00,$04,$4C,$45,$44,$20,$4F,$6E,$00,$01,$01,$00,$10,$27,$04,$4C,$45,$44,$20,$4F,$66,$66,$00,$01,$00,$00,$00,$00,$04,$54,$6F,$67,$67,
$6C,$65,$20,$4C,$45,$44,$00,$02,$00,$00,$00,$00) org $007C8
' Menu Name:'SettingsMenu'
' Title: 'Settings'
' Address: 2164
' Menu Items. Count:2
' Type Label Pointer CMD P1 P2
' =========================================================
' 0 'MI1' 1992
' 0 'MI2' 1992
CONST SettingsMenu as BYTE[25]=(
$01,$53,$65,$74,$74,$69,$6E,$67,$73,$00,$02,$00,$4D,$49,$31,$00,$E4,$03,$00,$4D,$49,$32,$00,$E4,$03) org $00874
Code: Select all
' {MANAGED OBJECT KEEPALIVES START}
t_Byte=@MainMenu
t_Byte=@SettingsMenu
t_Byte=@MaintenanceMenu
t_Byte=@CalMenu
t_Byte=@LU1
t_Byte=@LU_DistanceUM
t_Byte=@LU_TempUnits
t_Byte=@luEffency
' {MANAGED OBJECT KEEPALIVES START}
Code: Select all
;MotoGadget.mbas,1198 :: t_Byte=@MainMenu
0x7142 0x0EC8 MOVLW _MainMenu
0x7144 0x6FE4 MOVWF _T_Byte, 1