Showing posts with label Memory Mapping. Show all posts
Showing posts with label Memory Mapping. Show all posts

Saturday, February 5, 2011

Data segment in c




All the segments are used
for specific purpose. Like segment number 15 is used for ROM, segment number 14
is used for BIOS etc.











We will discuss about how to access text video
memory, graphics video memory in the pointer and union chapters of 255 bits
color graphics programming.


Segment number eight has special name which is known
as data segment. This segment has been divided

What is offset address


What is
offset address?

Offset address and segment
number in c programming language






Each segment has divided into two parts.









1. Segment no (4 bit)




2. Offset address (16 bit)












So, in the other words we can say memory address of
any variable in c has two parts segment number and offset address.



In turbo c 3.0 a particular segment number offset
address varies from

Memory segment | Segment address


Memory
segmentation in 8086 microprocessor : Segmented
memory






Resident memory of RAM of
size 1MB has divided into 16
equal parts. These parts is called segment. Each
segment
has size is 64 KB.



16 * 64 KB = 1 MB







This process of division is
known as segmentation.









Note: In turbo c 3.0 physical addresses of any
variables




are stored in the 20 bits. But we have not any

Wednesday, February 2, 2011

Physical address of a computer


Logical
address and physical address: How to find

or get a physical address of a RAM


physical address of computer or operating system

All the c variables are stored in the residence memory.

In turbo C 3.0, 20 bits address of the memory cell is
known as physical address or real address. In 20 bits,
we can represent address from 0x00000 to 0xFFFFF. That
is all c variables must have

what is resident memory




What is resident memory of a computer?



RAM has divided into two parts:

(1) Extended memory (useless)

(2) Residence memory




























































In Turbo C 3.0 compiler size of residence memory is 1MB.



resident memory:



When any program is executed it is stored in the
residence memory. For turbo c 3.0, it has 1MB residence

What is the ram of a computer?




What is the
ram memory: Memory cell in computer





Entire RAM has divided in numbers of equal parts, which are

known as memory cells. Following diagram represents the 256

MB RAM.









Each cell can store one-byte data. Data are stored in the
binary number system. That is a character data reserves one
memory cell while floating data reserves four memory cells.



Each memory cell

Difference between .com program and .exe program in c programming language



Both .com and .exe program are executable program
but .com program execute faster than .exe program. All drivers are .com
program. .com file has higher preference than .exe
For example:
Open the command prompt in window OS. (Type CMD in Run)
In the command prompt type notepad and press enter key you will get the notepad. Since it executes notepad.exe

Repeat the same task but now first create

Difference between TSR and TSO program


Difference between TSR and TSO program


TSO means terminate but stay outside.
It is that program, which release the main memory after the execution of the
program. Example ms paint, notepad, turbo c compilers etc.



TSR means terminate but stay
residence .It is those program, which after the execution of the program does not
release the RAM (main memory).e.g. antivirus.


List the five c

What will be address range which can be represented in 20 bit?





Binary

Hexadecimal


Min possible

0000 0000 0000 0000 0000

00000


Max possible

1111 1111 1111 1111 1111

FFFFF






In c any hexadecimal number start with 0x 0r 0X So, address range will be 0x00000 to 0xFFFFF. So in turbo C 3.0 memory address of all variables must be within 0x00000 to oxFFFFF.



It is 1MB memory range.



Note.

2^10 = 1KB

2^20 = 1MB

Hexadecimal representation in c


In
hexadecimal number system we use 16 different digits so its base is 16. List of
all hexadecimal digits:








Hexadecimal digit


Decimal equivalent


Binary equivalent




0


0


0000




1


1


0001




2


2


0010




3


3


0011




4


4


0100




5


5


0101




6


6


0110




7


7


0111




8


8


1000

Turbo c compiler




Turbo c is an IDE of c programming language created by Borland. Turbo C 3.0
is based on MS DOS operation
system. It is one of the most popular c compilers. It uses 8086 microprocessor which is 16
bit microprocessor. It has 20 address buses and 16 data bus. Its word length is
two byte.

Size of data types in Turbo C 3.0:






Data type


Size




short int


2




int


2


C compiler


There are various c compilers are variables. Some of these are:






S.N.


Name


Microprocessor


OS




1


Turbo c 3.0


8086


MS DOS




2


ANSIC C


80386


LINUX




3


Borland C 4.0


80386


WINDOW




4


Microsoft C


8086


MS DOS




5


Visual C++


80386


WINDOW





Note: 8086 is 16 bit microprocessor while 80386 is 32

Memory mapping in c


Basic knowledge before staring c programming language. To become best c programmer you must have knowledge about memory mapping.



1. List the five c compilers?

2. Describe turbo c compiler?

3. What is hexadecimal number system?

4. What will be address range which can be represented in 20 bit?

5. What is difference between TSR and TSO program?

6. What is difference between .com program and