Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 01-05-2011, 03:36 PM   #1 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Assembly Language Discussion Thread


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..............
RITESH is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 01-05-2011, 07:48 PM   #2 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: Assembly language programing in 8086up......!!

Looks like, no one here is much in to ASM programming.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is online now   Reply With Quote
Old 01-05-2011, 10:05 PM   #3 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

Hi,
in 8085 STA add. was used to save data, but how to save in 8086 which instruction??
RITESH is offline   Reply With Quote
Old 03-05-2011, 08:08 PM   #4 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

REply.............................
RITESH is offline   Reply With Quote
Old 03-05-2011, 08:45 PM   #5 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default 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.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is online now   Reply With Quote
Old 03-05-2011, 11:25 PM   #6 (permalink)
XLr8
 
arpanmukherjee1's Avatar
 
Join Date: Sep 2008
Posts: 637
Default 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
__________________
Quote:
There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
arpanmukherjee1 is offline   Reply With Quote
Old 03-05-2011, 11:57 PM   #7 (permalink)
In The Zone
 
Join Date: Mar 2011
Location: Mumbai
Posts: 222
Default Re: Assembly language programing in 8086up......!!

i have studied 8085.maybe i can assist u?
coolgame is offline   Reply With Quote
Old 04-05-2011, 12:52 AM   #8 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default 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)

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
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 07-05-2011, 09:55 PM   #9 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

Hi again,

i have used STA in 8086 emu stimulator but it was showing an error..!!
RITESH is offline   Reply With Quote
Old 08-05-2011, 08:08 AM   #10 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

If its not working, then use the indirect addressing mode.
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 08-05-2011, 08:59 PM   #11 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

Quote:
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??
RITESH is offline   Reply With Quote
Old 09-05-2011, 07:02 AM   #12 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

Sorry, i cant get you buddy... please make it clearer
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 10-05-2011, 10:31 PM   #13 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default 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??
RITESH is offline   Reply With Quote
Old 10-05-2011, 10:54 PM   #14 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default 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?
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 11-05-2011, 09:03 AM   #15 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

HI,

In this fig. 4 segment are used for 256kb then what about rest of memory??
Attached Images
File Type: jpg 12.JPG (41.5 KB, 10 views)
RITESH is offline   Reply With Quote
Old 11-05-2011, 09:33 PM   #16 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

memory-segment-8086.jpg

Hope you understand from the diagram....
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 12-05-2011, 08:29 AM   #17 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

That mean 746KB size is of IP register only??
RITESH is offline   Reply With Quote
Old 12-05-2011, 10:33 AM   #18 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default 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
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 12-05-2011, 09:51 PM   #19 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default 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.........
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 13-05-2011, 05:10 AM   #20 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default 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!!!
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 13-05-2011, 10:03 AM   #21 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

Hi again,

please a small program how to use in & out port in 8085 stimulator??
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 13-05-2011, 03:20 PM   #22 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

Sorry dude, I dunno how to use the 8085 simulator..
Tried once but i dont like it like the processor kit

But let me give you a clear program in Assembly.

before that how to use the in and out instructions?

Code:
IN 8-bit port address

OUT 8-bit port address
IN instruction gets input from the user via the specified 8 bit port and stores it in the accumulator.
OUT instruction displays or makes available the contents of the accumulator on the specified port.

Now the simple program to add two numbers and display its result using IN and OUT

Code:
MVI B,34H
IN F2H
ADD B
OUT F3H
HLT
Explanation line by line:
1. Moves the hex value 34H into B register
2. Gets input via port F2H and stores it in accumulator
3. Adds the content of B register(34H) to the contents of accumulator (which you entered)
4. Displays the result or makes the result available at port F3H
5. Halts the program
__________________
The secret ingredient is nothing

Last edited by Anish; 13-05-2011 at 04:28 PM.
Anish is offline   Reply With Quote
Old 13-05-2011, 04:40 PM   #23 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

The IN & out command are not dirctly connected to up in real i think for this PIO is used or not??

Quote:
Sorry dude, I dunno how to use the 8085 simulator..
Tried once but i dont like it like the processor kit
If you want to run then you may download Oshon 8085 stimulator then select tool -> ass. write your simple ass. lang. program then Load it with compliling in above option given in ass., try this will help you..
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 13-05-2011, 07:14 PM   #24 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

Quote:
Originally Posted by RITESH View Post
If you want to run then you may download Oshon 8085 stimulator then select tool -> ass. write your simple ass. lang. program then Load it with compliling in above option given in ass., try this will help you..
I will surely give it a try.. But what is the use of learning assembly when there are much sophisticated languages such as python and c out there?

I advice you to learn python as it is easy and also widely popular language.
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 13-05-2011, 07:36 PM   #25 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

You know how to use 8085 up??
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 13-05-2011, 08:00 PM   #26 (permalink)
In The Zone
 
Anish's Avatar
 
Join Date: Jul 2008
Location: Golden City
Posts: 320
Default Re: Assembly language programing in 8086up......!!

yes, i have used it in trainer kit in my lab practicals... and never used in any of my individual projects yet.

what is the use of old 8085 when there are advanced controllers such as PIC 16F877 ?????
__________________
The secret ingredient is nothing
Anish is offline   Reply With Quote
Old 13-05-2011, 09:24 PM   #27 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

Yeah, but i want to go with basic...., see my projects (signature)
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 15-05-2011, 11:26 AM   #28 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

In 8086 up the pin s3 & s4 are given for choosing which segment of memory to be used DS,ES,SS,CS how it choose memory by 2 bit as whole memory is of 20bits i.e. 1MB??
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 18-05-2011, 10:46 AM   #29 (permalink)
Right Off the Assembly Line
 
RITESH's Avatar
 
Join Date: Apr 2011
Posts: 39
Default Re: Assembly language programing in 8086up......!!

reply..............

reply.......................!!

please, reply.................................
__________________
You tube channel..http://www.youtube.com/user/29riteshkakkar
RITESH is offline   Reply With Quote
Old 18-05-2011, 03:30 PM   #30 (permalink)
Bang! Bang!
 
noja's Avatar
 
Join Date: Nov 2010
Posts: 125
Default Re: Assembly language programing in 8086up......!!

I only know 8085 which is like reverse of 86
noja is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2