If enabled, a new file will be generated with the name 'P18Fxxxx.bas' to match the corresponding device file.
The bit names are defined as a const matching the register bit number and are taken from the asm .inc file.
You can't use the names directly (ie INTCON.GIE) so you'd normally use them with the '.bits()' or '.booleans()' qualifiers like so:
Code: Select all
device=18F26K22
include "P18F26K22.bas" // include the reg bit definition file
INTCON.bits(GIE) = 0
T0CON.booleans(TMR0ON) = true
// or in other statements like
error_mask = (1<<OERR) + (1<<FERR)
- There are a lot of duplicate bit names in the asm files and the program will only generate a definition for the first one it sees. It's a good idea to make sure it's the right bit number. Since they're just constants there's no way to check that the bitname is actually valid for the register... that's up to you!
- The bit names don't always match up very well with what's in the datasheet. You may want to generate the files one time and adjust it to match your liking.
There are far too many files/definitions for me to test so if you run across a file that causes problems or has errors please post it here so I can try to fix the generator. You may find names that clash with other common symbols or reserved words... who knows.