Solved

max memory capacity of turbo C small model

Posted on 2003-12-06
6
406 Views
Last Modified: 2010-04-17
 hello
     I wrote a code in Turbo C involving complex numbers upto [17][256] 2d-array.    When I run this program, I receive "Abnormal Termination" and application performed Illegal operation. I want to know what is the max limit of usage of memory. If I want to exceed the limit, what should I do.

   Iam working on Turbo C,windows 98,128RAM(32 shared)

Thanking you
best regards
srikanth
0
Comment
Question by:cbodapati
[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
  • 3
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
cookre earned 25 total points
ID: 9891358
Small model limit is 64K, plenty that array.  If you need more, move up to large model and use MAPIAllocateBuffer.  Note that alloc() is limited to 64K per call.

Illegal operation means execution got to a bad instruction.  A likely candidate for this an index that went beyond the bounds of an array, wiping out code.  This is usually requires some effort to do - except in the small model where both data and code are in the same segment.
0
 
LVL 1

Expert Comment

by:th83
ID: 9891871
You can use "far pointer" to allocate more memory then 64k.
0
 
LVL 22

Expert Comment

by:cookre
ID: 9892144
Huh?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:th83
ID: 9892456
void far *farcalloc(unsigned long nunits, unsigned long unitsz);

farcalloc allocates memory from the far heap for an array containing nunits elements, each unitsz bytes long.

NOTE: For allocating from the far heap:
■ all available RAM can be allocated.                                      
■ blocks larger than 64K can be allocated.                                  ■ far pointers (or huge pointers if blocks                                
are larger than 64K) are used to access the allocated blocks.

char far *fptr;                                                          
 /* allocate memory for the far pointer */                                
fptr = (char far *) farcalloc(10, sizeof(char));


It has been years since i left console programming in  Turbo C. That is the reason i haave copied the above form Troubo C help.

Look at the  Turbo C Help for more information.



TH  


0
 
LVL 22

Expert Comment

by:cookre
ID: 9892488
Whew, a typo.  I was just a tad skeptical about using a type declaration to get memory.
I live mainly in the MS world where there is no farcalloc().
0
 

Assisted Solution

by:minamkhan
minamkhan earned 25 total points
ID: 9892923
small model limit is 64k and i tthink that it is too much for that array. Actually there will be a problem with ur code maybe problem with the declaration or with the index out of bound problem but if u wanna switch to large model in TC if u r using TC-300 or TC-3 compiler than click "options" than click "compiler" than click "Advanced code generation" and  a dialog box will be displayed in front of u than choose 80286 in "Instruction set"  and in the editbox there will be written "32767" erase it and write "65535"  also check farcheckptr in options.
now u can use far ptr or near ptr to allocate memory because ur program is now in large model
I hope that it will solve ur problem
Regards
minamkhan  
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

630 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