The MASM Forum

General => The Campus => Topic started by: Evan on December 07, 2013, 02:21:14 PM

Title: What I Want to do
Post by: Evan on December 07, 2013, 02:21:14 PM

Use Stack
Use first peaces of stack as registers


I have no idea how but I think I can use my memory properly.
Title: Re: What I Want to do
Post by: Evan on December 07, 2013, 03:35:10 PM
Can I use .data? as ram


??


As the numbers where computer chooses addresses for you?
Title: Re: What I Want to do
Post by: dedndave on December 07, 2013, 05:40:28 PM
.DATA is a "program section" that is essentially RAM
when a program is executed, all the sections are probably loaded into RAM (if it's not too big)
there are many ways to use the stack
a common way is to use PUSH and POP

        push    eax             ;the contents of the EAX register are saved on the stack
;
;other code
;
        pop     eax             ;the value at the top of stack is loaded into EAX
Title: Re: What I Want to do
Post by: jj2007 on December 07, 2013, 06:51:20 PM
Evan,

Tonight you have opened three new threads titled "What I Want to do New", "What if I mess up?" and "Yeah guys still I don't know".

I'm not the Forum police here, but do you thinks it's nice to dump your vague ideas into the Campus? If you really think it is important to ask such questions (what about reading a book? Art of Assembly, for example?), well, stick to this thread, and only this thread, and don't clutter the Campus with new threads all the time.

P.S.: Good reading maintained by a certain Evans. (http://www.cs.virginia.edu/~evans/cs216/guides/x86.html)
Title: Re: What I Want to do
Post by: dedndave on December 08, 2013, 01:01:53 AM
Jochen has a point, Evan
assembly language is not really for beginners
you should learn to perform some basic tasks before attempted the advanced ones
Title: Re: What I Want to do
Post by: K_F on December 08, 2013, 05:28:59 AM
Quote from: Evan on December 07, 2013, 02:21:14 PM
Use Stack
Generally this is automatic

Quote
Use first peaces of stack as registers
Local variables do this.

Also I'd be careful about stack over-usage.. you can mess things up very quickly.

Another thing you can do is grab some memory through the system allocator.
Your code signature would be smaller, but you'll use a lot of pointers and offsets

In any event they all use memory - it's just the method that differs.
Title: Re: What I Want to do
Post by: Evan on December 09, 2013, 06:34:02 PM
Quote from: dedndave on December 08, 2013, 01:01:53 AM
Jochen has a point, Evan
assembly language is not really for beginners
you should learn to perform some basic tasks before attempted the advanced ones
I am sorry. I am trying to think very small really hard.
Title: Re: What I Want to do
Post by: dedndave on December 09, 2013, 06:49:24 PM
it's ok - i can see you have a little trouble with English
you might try playing with
translate.google.com (http://translate.google.com)

you can type in one language and it will give you whatever other language you select