Assembly Language Discussion Thread

RITESH

Broken In
Hi,
i want to make program 8086, i am using emu 8086 stimulator, i want to know how to save data with variable name....??

Reply...........

please reply..............
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

Hi,
in 8085 STA add. was used to save data, but how to save in 8086 which instruction??
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

REply.............................
 

krishnandu.sarkar

Simply a DIGITian
Staff member
Re: Assembly language programing in 8086up......!!

Sorry mate, I suggest you to try somewhere else, I guess no one here is into ASM Programming. Otherwise you'd have got at least one reply.
 
Re: Assembly language programing in 8086up......!!

really sorry that you are stuck.

cant you contact any person who has done micro-controller programming or knows PLC
EC guys or teachers might know
 

Anish

Spectre
Re: Assembly language programing in 8086up......!!

Hi ritesh, I saw this thread only today...

here we go...
its the same for both.
"STA add"

here add refers to address right?( i assume so as u didnt care to elaborate):grin:

The same way, you can store the contents of accumulator in the 8086 by the instruction

Code:
STA (16bit address)
Example:
STA 2634H

And also you can use indirect addressing, where the address to store the reg a contents are given in another register pair say B. and the syntax is

Code:
STAX (Reg pair)
Example
STAX B

Using the above code stores your accumulator contents to the address which is in the B register pair.

Hope this helps:)
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

Hi again,

i have used STA in 8086 emu stimulator but it was showing an error..!!
 

Anish

Spectre
Re: Assembly language programing in 8086up......!!

If its not working, then use the indirect addressing mode.
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

If its not working, then use the indirect addressing mode.
Yeah, i is working Indirect add.

OK, in 8086up 16 bit add. locate 64Kb + 4bit make it 1MB. as there are 4 segmemt of 64KB each i.e. 246KB then where rest of memory is used??
 

Anish

Spectre
Re: Assembly language programing in 8086up......!!

Sorry, i cant get you buddy... please make it clearer
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

Hi again,

as in 8086 up 1MB is the maximum memory of it to be used, in which 4 64KB is reserved for segment registers like DS,SS,CS,ES makes 256kb then what about of rest memory left??
 

Anish

Spectre
Re: Assembly language programing in 8086up......!!

Hey, you have misunderstood buddy... Intel 8086 microprocessor can address 1MB of memory and doesn't contain 1MB of memory.

As you know (i assume), 8086 has a 20 bit address bus, So it can access 2^20 = 1 MB of memory. To elaborate it, Even when you interface a 4 GB ram, our 8086 can use only 1MB and the remaining memory remain waste.

And about that registers, every processor contains some registers within them through which we manipulate our calculations

Understood eh?
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

HI,

In this fig. 4 segment are used for 256kb then what about rest of memory??
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

That mean 746KB size is of IP register only??
 

Anish

Spectre
Re: Assembly language programing in 8086up......!!

Okay, lets get down to the facts... How can you say that each segment (cs,ds,es,ss) holds 64kb of memory
 
OP
RITESH

RITESH

Broken In
Re: Assembly language programing in 8086up......!!

It is written in many course book, that mean we can expand it???
Only these 5 take memory or some more registers also??

Please reply.........
 

Anish

Spectre
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....:smile:

Voila this is the longest post I've ever made in TDF!!!
 
Top Bottom