Intro to Assembly Programming (Background info to program a paintball marker)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fixion
    Registered User
    • Aug 2003
    • 815

    #16
    .... and that is why you pic a microcontroller, for which a C compiler exists, and if you really really like ASM, you can still write sections of your program in it. Understand kids?

    Besides, how are you going to port linux to the emag if you can't comile it for the processor? Better yet, pong?
    .

    Comment

    • sig11
      Registered User
      • Apr 2004
      • 95

      #17
      Originally posted by Fixion
      .... and that is why you pic a microcontroller, for which a C compiler exists, and if you really really like ASM, you can still write sections of your program in it. Understand kids?
      The problem is that the emag's microcontroller only has 2k flash, 128bytes of SRAM, and 128bytes EEPROM. Like Miscue already said... you won't get very many features into that if you use a high level language.


      The Atmel ASM suprises me with how easy it is. I was staring at some code I was given with the programmer and thinking "Why the hell would someone use decimal numbers in ASM?!" Finally after looking at the datasheet (forgot to print the key : ) for the hundreth time I realized that they were specifying certain bits in a register by its decimal index. So cool. In any other assembly language I've used before you had to use masks to set certain bits. Amazing time and mind saver.
      So nice to do 'sti PORTB, 6' instead of:
      'ldaa portb
      ldab $20
      orab
      stab
      '

      I probably butchered that since its been so long since I've written any 68HC11 code.... but you get the idea.

      Lee

      Comment

      • Miscue
        Super Moderator

        • Oct 2000
        • 7105

        #18
        Originally posted by Fixion
        .... and that is why you pic a microcontroller, for which a C compiler exists, and if you really really like ASM, you can still write sections of your program in it. Understand kids?

        Besides, how are you going to port linux to the emag if you can't comile it for the processor? Better yet, pong?
        There's no point in doing that. If 90% of your stuff is bloated, might as well do it 100%. If you're programming a PC game, and use inline ASM for parts that need to be very fast - this makes a lot of sense. A goal for ASM usage on a microcontroller is smaller size, when you have space limitations - you gotta do the whole thing in ASM for significant space savings.

        Comment

        • Mango
          i cant wait to blog this
          • Feb 2002
          • 4557

          #19
          ....

          Comment

          • Fixion
            Registered User
            • Aug 2003
            • 815

            #20
            Originally posted by Miscue
            There's no point in doing that. If 90% of your stuff is bloated, might as well do it 100%. If you're programming a PC game, and use inline ASM for parts that need to be very fast - this makes a lot of sense. A goal for ASM usage on a microcontroller is smaller size, when you have space limitations - you gotta do the whole thing in ASM for significant space savings.
            I understand both the advantages and disadvantages of ASM. I was joking
            ...and no, I didn't take the time to read Miscues second post, actually, I barely read the first few, I had to go to class.

            I've never seen the emag code, so I'm not going to assume anything. But I did not know what microcontroller the emag uses, so I assumed that its slightly better, faster, stronger (like the song ), had more memory, etc. than it actually is. If I knew its specs, I would have agreed that ASM is the only way. But I guess if you want to save money on parts and time on simplicity, thats the way to go.

            So, when can I play Duke Nukem Forever on an emag running *nix .
            .

            Comment

            • datapimp69
              Pimp Master Delux
              • Jun 2001
              • 1219

              #21
              hye, whats a stack. and why to i have to pop it?


              from the judge in the WDP v Sp case.... " i find it significant that aside from a somewhat limited notebook produced by gaston, the four named inventors offer NO documentation of there work or there contributions to the conception or reduction to practice of the claimed invention"

              Comment

              • sig11
                Registered User
                • Apr 2004
                • 95

                #22
                Originally posted by datapimp69
                hye, whats a stack. and why to i have to pop it?
                In my Theory of Computation class we always tried to get the prof off on some wild tangent... Got to be where he would say "Stack push" and start talking about whatever we pushed him to. Though he never popped off the stack when he'd go back to teaching. No wonder that class was so hard. Stack overflow.

                Lee

                Comment

                • mikey101
                  aka murdoc
                  • Jun 2001
                  • 790

                  #23
                  public class Stack
                  {
                  public static final int SIZE = 2;
                  private Object [] stck = new Object[SIZE];

                  public void push(Object x)
                  {
                  int i;
                  int y;
                  for(i = 0; i != null; i++)
                  { y = (i + 1);
                  }
                  stck[y] = x;
                  }
                  }

                  - index out of bounds exeception??? OHNOES!!
                  Java may not be as efficient as asm, but it's still cool with you guys right?

                  Comment

                  Working...