Re: Assembly language programing in 8086up......!!
Hi Ritesh, Its clear that you misunderstood the architecture and working of the 8086 microprocessor... But don't worry, I will explain it to you..
But be patient while you read this as it will help you better understand the basics.
Intel 8086 microprocessor is a 16-bit microprocessor (means it can process a 16 combinations of 0's and 1's at a time).It has 40 pins in a DIP package.
And actually nobody cares about the total memory of all the internal registers in a processor, all we have to know is the wordlength(how many bits can the register hold) of the registers.
There are many different registers in 8086(hope 29 are there) such as accumulator, base pointer, stack pointer, instruction pointer, segment registers etc... you can find the complete list and explanation
here
What matters is not the total memory the registers can hold.. its about how much memory can they access externally.. to explain this still deep,
When you are programming a 8086,
you are actually entering your program in a external RAM not inside the processor (as a processor within itself doesn't have space to hold programs).
When you are working on a 8086 programming kit, you can see a separate RAM chip to hold the programs that you enter. So,
you cannot write your program inside the processor itself.
The registers present inside the processor is used manipulate the data from the external memory you have interfaced (In this case the RAM). When simply referring to memory, it means external memory only.
Now, the processor will access the external memory space only with the help of the registers. The external memory space has a address specified to each block of 16-bit (since 8086 can process only 16-bit of information at a time).
The 8086 processor has 20 address pins in its physical structure(pins 2 to 16 plus 35 to 39).
This means it can access 1MB of external memory. Formula to calculate the amount of memory a processor can access is
2^(no.of.address lines), here there are 20 address lines so,
2^20 = 1048576 bytes = 1024 KB = 1MB
Unfortunately, internal registers of 8086 cannot hold 20 bits of address (to address 1MB) the longest register is only 16 bit in length. so, using registers, it can access
2^16 = 65536 bytes = 64KB
I hope this is where you confused. Using a single 16 bit register consecutively, It can access only 64KB of memory...
Now your question may be obviously, How the heck will it access 1MB of memory when a single register could hold only 16-bit address ?
The answer is, 8086 combines 2 registers of 16bit size(must be specified by the programmer to do so). Now, the first 16bit register contains the 16 address bits and the second 16bit register contains another 4 address bits so combined to give the 20 address bits to access 1MB of space... Many modern processors use this approach to address hell a lot of space with its minimal register width design.
you can get a more insight into this by following
this link. I strongly recommend you to take a look at this as what i hav explained will not suffice.
BTW, i recommend you to buy the book if you dont have it..
"Microprocessor architecture and programming with 8085" by Ramesh Gaonkar
This book will surely enrich your knowledge in microprocessor field dude...
Hope yu understand dude.....and i am always happy to help....
Voila this is the longest post I've ever made in TDF!!!