Hi Robert,
>>Onward to the 18f452. Ah... 16*256 bytes of ram. Now, how do I get at them?
The 18F452 doesn't have 16*256 bytes of RAM. Only 1,536 bytes in 6 banks with 256 bytes per bank.
PBP handles everything for you. Just create your variables, and PBP will assign them all to RAM automatically for you.
You don't need to mess with BSR bits or anything else.
You can create 16 * 16-byte arrays like this.
A VAR BYTE[16]
B VAR BYTE[16]
C VAR BYTE[16]
D VAR BYTE[16]
E VAR BYTE[16]
F VAR BYTE[16]
G VAR BYTE[16]
H VAR BYTE[16]
I VAR BYTE[16]
J VAR BYTE[16]
K VAR BYTE[16]
L VAR BYTE[16]
M VAR BYTE[16]
N VAR BYTE[16]
O VAR BYTE[16]
P VAR BYTE[16]
Of course you can also do it the long way, and create 256 individual variables.
To see how PBP is assigning your variables to RAM, just open the .lst file created at compile time. You'll see something like this for the above arrays.
_B EQU RAM_START + 02BH
_C EQU RAM_START + 03BH
_D EQU RAM_START + 04BH
_E EQU RAM_START + 05BH
_F EQU RAM_START + 06BH
_G EQU RAM_START + 07BH
Etc, etc,,




Bookmarks