Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The Stack: which comes first?

The Stack: which comes first?

Scheduled Pinned Locked Moved The Lounge
data-structuresquestion
25 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    puromtec1
    wrote on last edited by
    #1

    So I'm doing some assembly for Z80/TI-83 plus on a routine basis in the evenings...and am stumped by a conundrum: Am I messing up the stack? Or, is the stack messing up me?

    Mike HankeyM C 2 Replies Last reply
    0
    • P puromtec1

      So I'm doing some assembly for Z80/TI-83 plus on a routine basis in the evenings...and am stumped by a conundrum: Am I messing up the stack? Or, is the stack messing up me?

      Mike HankeyM Offline
      Mike HankeyM Offline
      Mike Hankey
      wrote on last edited by
      #2

      The stack is a bi-directional cluster f**k, or to put it another way sometimes you get the bear and sometimes the bear s&*ts on you. :) Good luck

      I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

      P R 2 Replies Last reply
      0
      • Mike HankeyM Mike Hankey

        The stack is a bi-directional cluster f**k, or to put it another way sometimes you get the bear and sometimes the bear s&*ts on you. :) Good luck

        I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

        P Offline
        P Offline
        puromtec1
        wrote on last edited by
        #3

        yeah.... My choice is peg a value to memory with a label, or be slick and use the stack in a sort of juggling act. When the push/pop spans a lot of other commands, it is a weird mind game to keep it all straight I think.

        Mike HankeyM 1 Reply Last reply
        0
        • P puromtec1

          yeah.... My choice is peg a value to memory with a label, or be slick and use the stack in a sort of juggling act. When the push/pop spans a lot of other commands, it is a weird mind game to keep it all straight I think.

          Mike HankeyM Offline
          Mike HankeyM Offline
          Mike Hankey
          wrote on last edited by
          #4

          One of the hardest concepts I've run into while doing assembly is the concept of frame pointers. I finally got a pretty good handle on it but it took a while. What are you doing with the chips..just playing or something substantial?

          I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

          P 1 Reply Last reply
          0
          • Mike HankeyM Mike Hankey

            One of the hardest concepts I've run into while doing assembly is the concept of frame pointers. I finally got a pretty good handle on it but it took a while. What are you doing with the chips..just playing or something substantial?

            I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

            P Offline
            P Offline
            puromtec1
            wrote on last edited by
            #5

            Doing a hobby project for someone that lets users enter a test of multiple choice questions into a TI calculator where choosing the right answers make an attached TI-robot drive it forward--for the kids in schools to use. The fellow who asked for it does other stuff with the calcs but can't program, so I've thrown my hat in the ring. It has been a heck of a learning curve for me, but I am cruising, finally. What are frame pointer? Any good books you recommend? I have access to books 24x7 and have begun reading a book on assembly.

            L Mike HankeyM 2 Replies Last reply
            0
            • P puromtec1

              Doing a hobby project for someone that lets users enter a test of multiple choice questions into a TI calculator where choosing the right answers make an attached TI-robot drive it forward--for the kids in schools to use. The fellow who asked for it does other stuff with the calcs but can't program, so I've thrown my hat in the ring. It has been a heck of a learning curve for me, but I am cruising, finally. What are frame pointer? Any good books you recommend? I have access to books 24x7 and have begun reading a book on assembly.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              No one uses frame pointers in z80 code anyway - at least not AFAIK. You rarely have any spare 16bit registers - especially not if you spilled some variables to the stack already. Maybe IX, but it's a PITA to use. And you can't do a 16bit indirect load. And there is no base+offset addressing mode except for the index registers, but as I said, they're a PITA to use. They (index registers) also bloat your code. I've seen them in crappy compiler output though..

              P Mike HankeyM OriginalGriffO 3 Replies Last reply
              0
              • L Lost User

                No one uses frame pointers in z80 code anyway - at least not AFAIK. You rarely have any spare 16bit registers - especially not if you spilled some variables to the stack already. Maybe IX, but it's a PITA to use. And you can't do a 16bit indirect load. And there is no base+offset addressing mode except for the index registers, but as I said, they're a PITA to use. They (index registers) also bloat your code. I've seen them in crappy compiler output though..

                P Offline
                P Offline
                puromtec1
                wrote on last edited by
                #7

                At this point, I've probably staked out all of the command styles I think I need for my app, too. But, in the larger scheme of things, pretty much anything dealing with cpu/memory is of interest to me.

                1 Reply Last reply
                0
                • P puromtec1

                  Doing a hobby project for someone that lets users enter a test of multiple choice questions into a TI calculator where choosing the right answers make an attached TI-robot drive it forward--for the kids in schools to use. The fellow who asked for it does other stuff with the calcs but can't program, so I've thrown my hat in the ring. It has been a heck of a learning curve for me, but I am cruising, finally. What are frame pointer? Any good books you recommend? I have access to books 24x7 and have begun reading a book on assembly.

                  Mike HankeyM Offline
                  Mike HankeyM Offline
                  Mike Hankey
                  wrote on last edited by
                  #8

                  Sounds like a worthy project. I'm doing a project in 'C' on an ATMega to control electrical devices, am currently putting together a proof-of-concept for a friend and potential partner.

                  puromtec1 wrote:

                  What are frame pointer?

                  here[^]

                  puromtec1 wrote:

                  Any good books you recommend?

                  hmm depends on what device you want to program. Assemblers are similar in concept they deal with moving data, doing calculations, etc. but each manufacturer of chips have there own instruction set. I've written a brief intro to AVR assembler here[^] that will introduce some basic concepts.

                  I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                  P S 2 Replies Last reply
                  0
                  • Mike HankeyM Mike Hankey

                    Sounds like a worthy project. I'm doing a project in 'C' on an ATMega to control electrical devices, am currently putting together a proof-of-concept for a friend and potential partner.

                    puromtec1 wrote:

                    What are frame pointer?

                    here[^]

                    puromtec1 wrote:

                    Any good books you recommend?

                    hmm depends on what device you want to program. Assemblers are similar in concept they deal with moving data, doing calculations, etc. but each manufacturer of chips have there own instruction set. I've written a brief intro to AVR assembler here[^] that will introduce some basic concepts.

                    I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                    P Offline
                    P Offline
                    puromtec1
                    wrote on last edited by
                    #9

                    Thanks, AVR looks like a good platform. I'll keep your site for reference.

                    1 Reply Last reply
                    0
                    • L Lost User

                      No one uses frame pointers in z80 code anyway - at least not AFAIK. You rarely have any spare 16bit registers - especially not if you spilled some variables to the stack already. Maybe IX, but it's a PITA to use. And you can't do a 16bit indirect load. And there is no base+offset addressing mode except for the index registers, but as I said, they're a PITA to use. They (index registers) also bloat your code. I've seen them in crappy compiler output though..

                      Mike HankeyM Offline
                      Mike HankeyM Offline
                      Mike Hankey
                      wrote on last edited by
                      #10

                      I've never really had a reason to use them either but used to find them in code that I was going through so had to learn about them. In uControllers you may have the registers to use but memory is at a premium so they are not used.

                      I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                      1 Reply Last reply
                      0
                      • P puromtec1

                        So I'm doing some assembly for Z80/TI-83 plus on a routine basis in the evenings...and am stumped by a conundrum: Am I messing up the stack? Or, is the stack messing up me?

                        C Offline
                        C Offline
                        CaptainSeeSharp
                        wrote on last edited by
                        #11

                        Now if you was obama you would just write an executive order and be done with it instead of actually going through the legitimate process.

                        Invisible Empire: A New World Order Defined (High Quality 2:14:01)[^] Watch the Fall of the Republic (High Quality 2:24:19)[^] The Truthbox[^]

                        M C H P 4 Replies Last reply
                        0
                        • C CaptainSeeSharp

                          Now if you was obama you would just write an executive order and be done with it instead of actually going through the legitimate process.

                          Invisible Empire: A New World Order Defined (High Quality 2:14:01)[^] Watch the Fall of the Republic (High Quality 2:24:19)[^] The Truthbox[^]

                          M Offline
                          M Offline
                          M o r r i0
                          wrote on last edited by
                          #12

                          In the ~5 years you've been here i'm sure you've heard at least once that politics don't belong in the lounge... So enjoy your 1's :cool:

                          1 Reply Last reply
                          0
                          • Mike HankeyM Mike Hankey

                            Sounds like a worthy project. I'm doing a project in 'C' on an ATMega to control electrical devices, am currently putting together a proof-of-concept for a friend and potential partner.

                            puromtec1 wrote:

                            What are frame pointer?

                            here[^]

                            puromtec1 wrote:

                            Any good books you recommend?

                            hmm depends on what device you want to program. Assemblers are similar in concept they deal with moving data, doing calculations, etc. but each manufacturer of chips have there own instruction set. I've written a brief intro to AVR assembler here[^] that will introduce some basic concepts.

                            I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                            S Offline
                            S Offline
                            S Senthil Kumar
                            wrote on last edited by
                            #13

                            Mike Hankey wrote:

                            AVR assembler

                            Do you use their IDE (Avr Studio 4)?

                            Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                            Mike HankeyM 1 Reply Last reply
                            0
                            • C CaptainSeeSharp

                              Now if you was obama you would just write an executive order and be done with it instead of actually going through the legitimate process.

                              Invisible Empire: A New World Order Defined (High Quality 2:14:01)[^] Watch the Fall of the Republic (High Quality 2:24:19)[^] The Truthbox[^]

                              C Offline
                              C Offline
                              Christian Graus
                              wrote on last edited by
                              #14

                              CaptainSeeSharp wrote:

                              Now if you was obama

                              I am impressed by the high level of education in Ohio. Did you finish primary school, and you still talk like this ?

                              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                              R G M 3 Replies Last reply
                              0
                              • S S Senthil Kumar

                                Mike Hankey wrote:

                                AVR assembler

                                Do you use their IDE (Avr Studio 4)?

                                Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                                Mike HankeyM Offline
                                Mike HankeyM Offline
                                Mike Hankey
                                wrote on last edited by
                                #15

                                Yes, it's a fairly decent IDE, VS style. I tried several other IDEs as I state here[^] but AVR Studio was the best.

                                I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                                1 Reply Last reply
                                0
                                • L Lost User

                                  No one uses frame pointers in z80 code anyway - at least not AFAIK. You rarely have any spare 16bit registers - especially not if you spilled some variables to the stack already. Maybe IX, but it's a PITA to use. And you can't do a 16bit indirect load. And there is no base+offset addressing mode except for the index registers, but as I said, they're a PITA to use. They (index registers) also bloat your code. I've seen them in crappy compiler output though..

                                  OriginalGriffO Offline
                                  OriginalGriffO Offline
                                  OriginalGriff
                                  wrote on last edited by
                                  #16

                                  harold aptroot wrote:

                                  I've seen them in crappy compiler output though.

                                  Yeah - the IAR C compiler makes heavy use of them. POS program, it was easier and quicker to code it in Z80 assembler most of the time.

                                  Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

                                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                  1 Reply Last reply
                                  0
                                  • Mike HankeyM Mike Hankey

                                    The stack is a bi-directional cluster f**k, or to put it another way sometimes you get the bear and sometimes the bear s&*ts on you. :) Good luck

                                    I wouldn't have to be such a smartass if you weren't such a dumbass. http://www.hq4thmarinescomm.com[^] My Site

                                    R Offline
                                    R Offline
                                    Roger Wright
                                    wrote on last edited by
                                    #17

                                    Stacks are always fun to manage, and that's one of the best reasons for the existence of HLLs...

                                    Will Rogers never met me.

                                    Mike HankeyM 1 Reply Last reply
                                    0
                                    • C Christian Graus

                                      CaptainSeeSharp wrote:

                                      Now if you was obama

                                      I am impressed by the high level of education in Ohio. Did you finish primary school, and you still talk like this ?

                                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                      R Offline
                                      R Offline
                                      Roger Wright
                                      wrote on last edited by
                                      #18

                                      You beat me to it...

                                      Will Rogers never met me.

                                      1 Reply Last reply
                                      0
                                      • C Christian Graus

                                        CaptainSeeSharp wrote:

                                        Now if you was obama

                                        I am impressed by the high level of education in Ohio. Did you finish primary school, and you still talk like this ?

                                        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                        G Offline
                                        G Offline
                                        Gary R Wheeler
                                        wrote on last edited by
                                        #19

                                        I must have missed this. You mean this twerp lives in Ohio? Nish and I will have to pay him a visit. :rolleyes:

                                        Software Zen: delete this;
                                        Fold With Us![^]

                                        C 1 Reply Last reply
                                        0
                                        • C Christian Graus

                                          CaptainSeeSharp wrote:

                                          Now if you was obama

                                          I am impressed by the high level of education in Ohio. Did you finish primary school, and you still talk like this ?

                                          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                                          M Offline
                                          M Offline
                                          Michael Schubert
                                          wrote on last edited by
                                          #20

                                          Christian Graus wrote:

                                          I am impressed by the high level of education in Ohio. Did you finish primary school, and you still talk like this ?

                                          youse always pickin' on da poor guy. he ain't done nuthin'. his grammerz and spellz alrite.

                                          Go and never darken my towels again - Groucho Marx

                                          R 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups