There was a bug in the addition/subtraction code for word variables, when subtracting from a constant it was asking for a byte sized temporary variable, then trying to access the high byte of the variable. This should now be fixed in the latest update (9/8).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi again.
Compiling this code with last update (0.9 16/6/2009):
#chip 16f876a, 20 'mhz
dim my_var1 as word
my_var1 = 500 -my_var1
I have this error:
Error [113] Symbol not previously defined (SysTemp1_H).
And the variable allocation in the generated asm is this:
;********************************************************************************
;Set aside memory locations for variables
DELAYTEMP EQU 112
MY_VAR1 EQU 32
MY_VAR1_H EQU 33
SysTemp1 EQU 34
;********************************************************************************
SysTemp1_H is not defined.
DELAYTEMP is allocated but not needed.
For example this code works ok:
dim my_var1 as word
my_var1 = 500 -my_var1
my_var1 = -my_var1
But with this code:
dim my_var1 as word
my_var1 = 500 -my_var1 +1
I have this error:
Error [113] Symbol not previously defined (SysTemp2_H).
And the var allocation is:
;********************************************************************************
;Set aside memory locations for variables
DELAYTEMP EQU 112
MY_VAR1 EQU 32
MY_VAR1_H EQU 33
SysTemp1 EQU 34
SysTemp1_H EQU 35
SysTemp2 EQU 36
;********************************************************************************
Looks that the problem is in the last system word variable, high byte not declared..
There was a bug in the addition/subtraction code for word variables, when subtracting from a constant it was asking for a byte sized temporary variable, then trying to access the high byte of the variable. This should now be fixed in the latest update (9/8).
So there's a new update?
lol
Jz
Ok... solved problem. Thanks Hugh.
This update has a lot of work, isn't it?... about 1000 more lines just in gcbasic.bas!!