[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Borland C V3.1 embedded design

Posted on 2002-07-03
4
Medium Priority
?
253 Views
Last Modified: 2010-04-15
Can anyone assist with a Borland C V3.1 problem. I am using battery backed up ram in an embedded system and have some variables I do not want initialized on reset or power up. How do I overcome this problem ?

Thank you
CarlB
0
Comment
Question by:carlbeck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:havman56
ID: 7126440
declare those variables as local in stack.. dont initialise it!

see if it is global then it will be in .bss section  so during ur startup routine dont initailse to zero.
0
 
LVL 11

Accepted Solution

by:
dimitry earned 150 total points
ID: 7130298
If it is your embedded system maybe you can simply use some constant physical address for your variables that is not part of DATA segment. In order to access some physical address in real mode you can do next:
#include <dos.h>
#define MY_VAR_SEG    0xHHHH
#define MY_VAR_OFF    0xOOOO

/* for "int" variable */
int far *myVar = (int far *)MK_FP(MY_VAR_SEG,MY_VAR_OFF);

int foo()
{
  *myVar = 25; /* Set 25 to address [0xHHHH:0xOOOO] */
}

0
 
LVL 20

Expert Comment

by:jmcg
ID: 10052530
Nothing has happened on this question in more than 18 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by dimitr [grade B] (only partial answer).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question