Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,383 Programmers. There are 1,385 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

ASM/Assembler language

 
Reply to this topicStart new topic

ASM/Assembler language

Begueradj
post 31 Mar, 2008 - 01:23 AM
Post #1


New D.I.C Head

*
Joined: 4 Mar, 2008
Posts: 2



Hi from Begueradj ,
In fact, could we use 2 stacks in an ASM code ?

thank you very much for your answer
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


born2c0de
post 31 Mar, 2008 - 04:38 AM
Post #2


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,298

There is only one stack which the processor uses.
But you could implement a stack and use it in Assembly.
What is your target processor?


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

NickDMax
post 5 Apr, 2008 - 12:41 PM
Post #3


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,024

It is possible to set the stack pointer to point to a new location. Thus having "two stacks".

As born2c0de mentioned it is also possible to implement the stack data srtucture and have as many stacks as you want... just don't confuse those stacks with "the stack". You have to write your own push/pup routines, and can't use the ones used by the processor.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Asm_Dood
post 6 Apr, 2008 - 05:08 PM
Post #4


New D.I.C Head

*
Joined: 6 Apr, 2008
Posts: 2

It's quite simple, you just change the stack pointer to wherever you want. If you really wanted to have 2 complete stacks you'd have to use another address register to function as a stack pointer, however. Additionally, you'd need, as NickDMax said, your own push/pop routines
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 03:42AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month