I'm using a pic18f2620 with 64k flash and need to define a large space (32k or so) of characters containing literals. Couldn't find how to do it. It will be the asm equivalent of .DB
or .DC
Also, is there an equivalent of asm ORG directive ?
TIA, Andrew.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not very good with MPASM, that's why I like GCBasic! GCBasic seems to hang on the DA and DATA commands. In GCBasic you can set a constant to a string like:
#define myString "hello world"
dim myString as string
GCBasic then creates a stringtable in program memory.
Tried out your data blocks and this seemed to work:
asm db 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09
asm db 10, 11, 12, 13, 14, 15, 16, 17
GCBasic chokes on hex with characters:
asm db 0x0A ;Works
asm db 0x0A, 0x0B ;Does not work & throws an illegal char code
In GCBasic I would think that an array would work for fairly large data blocks, I forget the limit offhand. In this case GCBasic will keep track of your data location for you. Try messing with Org at your own peril.
I'm using a pic18f2620 with 64k flash and need to define a large space (32k or so) of characters containing literals. Couldn't find how to do it. It will be the asm equivalent of .DB
or .DC
Also, is there an equivalent of asm ORG directive ?
TIA, Andrew.
I have found the solution for ORG by using:
asm ORG 0x00
Howewer, when i code:
asm DATA "foobar"
the resulting asm file says:
; asm DATA "foobar"
; string1;
and no code (data) is generated....
any clue ?. thanks.
Not very good with MPASM, that's why I like GCBasic! GCBasic seems to hang on the DA and DATA commands. In GCBasic you can set a constant to a string like:
#define myString "hello world"
dim myString as string
GCBasic then creates a stringtable in program memory.
Tried out your data blocks and this seemed to work:
asm db 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09
asm db 10, 11, 12, 13, 14, 15, 16, 17
GCBasic chokes on hex with characters:
asm db 0x0A ;Works
asm db 0x0A, 0x0B ;Does not work & throws an illegal char code
In GCBasic I would think that an array would work for fairly large data blocks, I forget the limit offhand. In this case GCBasic will keep track of your data location for you. Try messing with Org at your own peril.
Dim myPattern(8)
myPattern() = (0x01, 0x10, 0x20, 0x40, 0x60, 0x80, 0x08, 0x09)