Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

max memory capacity of turbo C small model

Posted on 2003-12-06
6
Medium Priority
?
407 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 75 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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 75 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

721 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