You might also have some problems with on and off. These are defined by the compiler as 1 and 0, and used internally in quite a few places. Setting them to 2 and 1 could cause problems, it would be safer to rename these constants (or use the compiler's own definition of On = 1 and Off = 0 if you can).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And, if you would like a simple list of all the reserved commands, the following general rules apply.
Look in your installation for ..\GCB@Syn\SynWrite\Data\autocomplete\GreatCowBasic.gcb - this file has the command set. Do not use these as varaibles unless you intended to.
Do not create variables or constants that use any registers or bits specified in the chip specific datasheet unless you know what you are doing.
Look in your ASM file. All your defined variables are shown is you review the section where all the vairables are defined then this can really help understand if you have an errant variable description. You will also see the variables used by the Great Cow BASIC libraries.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I try to send the controller to sleep. But instead of a sllep command the compiler create a "3". see below.
The GCB code
The asm code look like this:
;SMCR.SE = 1
in SysValueCopy,SMCR
sbr SysValueCopy,1<<SE
out SMCR,SysValueCopy
;asm sleep
3
GCASM create such report
A warning has been generated:
Warning: GCASM: Value out of range: Least significant bits used
Chip: MEGA328P
Compiler Version: 0.95 2016-06-26
I slove the Problem
befor the code above I have a Select Case Statement. The variable in the Statment can have 3 Values
.#define sleep 1
.#define on 2
.#define off 1
In the first Definition was the Problem. The Defninition sleep clash with the asm Statment
You might also have some problems with on and off. These are defined by the compiler as 1 and 0, and used internally in quite a few places. Setting them to 2 and 1 could cause problems, it would be safer to rename these constants (or use the compiler's own definition of On = 1 and Off = 0 if you can).
And, if you would like a simple list of all the reserved commands, the following general rules apply.
Thank you for the Reply. Hugh and Anobium.
The comments help me.
The "GreatCowBasic.gcb" is a good Tip