CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

#reserve warning/error difference between compiler versions

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ncdoody



Joined: 30 May 2023
Posts: 12

View user's profile Send private message

#reserve warning/error difference between compiler versions
PostPosted: Thu Oct 05, 2023 5:14 pm     Reply with quote

Updated from 5.075 to 5.115 and what used to be a warning is now an error, i.e. on the line

Code:
#RESERVE 0x0C0, 0x0C1, ...


I get:
>>> Warning 228 "C:\Users\...\def_file.h" Line 100(2,9): Memory not available at requested location
with version 5.075

and get:
*** Error 174 "C:\Users\...\def_file.h" Line 100(2,9): Memory not available at requested location
with version 5.115

Tips?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Oct 06, 2023 1:26 am     Reply with quote

Would help if you told us what chip?.

However it really should be an error, since obviously the compiler cannot
reserve memory where it does not exist, and since it does not exist, will not
use it, so the statement does nothing.

What is the point of this?. What are you actually doing?.
ncdoody



Joined: 30 May 2023
Posts: 12

View user's profile Send private message

PostPosted: Fri Oct 06, 2023 9:35 am     Reply with quote

Apologies, it's legacy code that I'm still trying to understand myself. It's running on a 18C252.

From what I understand so far, they were reserving a ram location for rx/tx buffers. They were using addresses 0x0C0 to 0x0FF, so I believe that means in the general purpose registers of the Bank 0.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Oct 06, 2023 1:51 pm     Reply with quote

The addresses from 0x80 to 0xFF, are the upper part of the access bank.
This talks to SFR's, so cannot be used as RAM. This is why the
reserve is not being allowed..... These addresses are the Bank 15
SFR's.
Suspect somebody thought these were part of the low half of this
which is normal RAM.
ncdoody



Joined: 30 May 2023
Posts: 12

View user's profile Send private message

PostPosted: Fri Oct 06, 2023 2:31 pm     Reply with quote

So, it seems to me that 0x080h to 0x0FF is in the GPR range of Bank 0 whereas 0xF80 to 0xFFF are in bank 15, i.e. the SFR. From the data sheet "The Access Bank is comprised of the upper 128 bytes in Bank 15 (SFRs) and the lower 128 bytes in Bank 0", but 0x0C0 to 0x0FF is within the upper range of bank 0, i.e. the GPR region. Right?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sat Oct 07, 2023 4:15 am     Reply with quote

Exactly.
This allows the port lathes and status registers to be accessed without
needing to do a bank switch.
Ypu can though see why the com[iler cannot let you prevent it from
accessing these!....
You need to find the bit of code that is trying to use these addresses,
and work out what it is actually up to.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group