http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack trouble




>Hi,
>
>I'm having some trouble programming the stack, I'm missing something here,
>and it's gotta be something REALLY simple! Here's an example of my code:
>
>	mov ax, 5
>	push ax
>	mov ax, 2
>	pop bx
>	add bx, ax
>	push bx
>	pop cx
>
>If I run this in Debug, I get CX as 2, why is this so? Shouldn't it be >7?

Yes, I believe it should be 7.  When I enter the code into debug as shown 
above and then check the CX register it does come up 7.

>Or what am I doing wrong? And yes, I know it can be done with
>
>	mov cx, 5
>	add cx, 2
>
>But I have reasons (very numerous and hard to explain) why it has to be
>like this, also the above isn't my exact code, it's just in the same
>format, I don't have the code with me right now, sorry.
>
Maybe there is a typo in your exact code or something.

Good luck with your compiler,

Ryan.

>I hope somebody can clear up what I'm missing!
>
>Ciao,
>
>Lionel
>
>=================================================================
>The GameProgrammer.Com mailing list is for the open discussion
>of any topic related to the art, science, and business of
>programming games. This list is especially tolerant of beginners.
>We were all beginners once
>
>To SUBSCRIBE or UNSUBSCRIBE please visit:
>http://gameprogrammer.com/mailinglist.html
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html




  • Follow-Ups: