Name: [1836] Neil Dickson
Member: 86 months
Authored: 10 videos
Description: Hi, I'm a performance optimization enthusiast with an interest for many sorts of tough challenges. I've started Code Cortex, a group working to make software performance easier to improve. My sites are: http://www.neildickson.com/ http://www.codecortex.com/ ...

Assembly Language Tutorial: Episode 3: The Stack and Looking Back [ID:975] (4/7)

in series: Assembly Language Tutorial

video tutorial by Neil Dickson, added 01/09

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

This video explains how parameters can be passed to functions using the stack or registers, and gives a more detailed look at the available general registers. After this, we try out the stack, implementing recursive flood fill.

Note that although local variables aren't shown in the flood fill implementation, these can be allocated by subtracting from esp (making space on the stack) after "mov ebp,esp", and freed by adding to esp before "pop ebp". Also not explained too well is that the pushing/popping ebp is to save/restore its old value. Push/pop can be used to save/restore other register values in a similar manner.

Also, part of the final program can be simplified after moving parameters into registers:

;Check that the pixel colour is the one we're covering

mov ecx,[ebp+8] ;ecx = index

cmp [ecx*4+edi],edx ;ecx*4+edi = index*4+pBitmap = pixel address

jne Done

;Set pixel colour

mov [ecx*4+edi],esi

I've got to stop ad-libbing the implementations or I'll give myself a heart attack. :D

Coding is done using Inventor IDE, which can be downloaded at http://www.codecortex.com/ide/ and it comes with this tutorial's base code as a sample project. A forum has been set up at http://www.codecortex.com/forum/ to post any questions, problems, suggestions, etc.

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 4270 (since July 30th)
  • Plays in last week: 12
  • Published: 68 months ago

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>








All comments excluding tick-boxed quick-comments

13. Michelle Fri, 06 Aug 2010 18:05

You rock, these vids are awesome!


12. Marshall Sat, 31 Jul 2010 02:22

The tutorials are pretty good. Hope that much more will come from you. Can I write a program that runs without any O.S? Once again thank u very much for tutorials.


hello! tnx for the tutorial...it is a help in my project in displaying japan national flag....

and i want to use this opportunity to ask if what are the things i should consider in the making of the program...and the correct interrupts and function i should use...

thanks

god bless


10. Maia Pavlenko Fri, 05 Feb 2010 05:43

Thanks, your lesson is very good, you saved me some time


I really enjoyed the tutorial. It is concise and right to the point.

I have one request though. When making the screen shots please remove the mouse off the way. It covers your typing and somewhat annoying.

Thank you for putting the tutorial together.


8. anonymous Wed, 15 Jul 2009 19:47

Good one


7. anonymous Fri, 08 May 2009 02:49

I liked it! Better than my teacher ;)


6. anonymous Wed, 01 Apr 2009 11:04

Very helpful. Thank you. I just discovered this site therefore, I have not had time to look at everything. I hope there is an index for the topics.


5. anonymous Fri, 06 Mar 2009 23:23

very nice tutorials...


Thanks for the feedback everyone! :)

I've been busy working on the next version of Inventor IDE (alpha 5), and I'll make another video in the next couple of weeks explaining the stack a bit more and giving a preview of the new Inventor IDE. It'll be an Episode 3.5 before we move on to the fun stuff starting in Episode 4. To be honest, I *love* making these videos and can't wait to get back at it, but the update to the IDE is absolutely worth it. You'll see why when I show it.


3. anonymous Sat, 14 Feb 2009 09:33

Really well done series... I look forward to your future episodes.


second Gasto. This series is on my must-watch list. Ta very much.


This series is worth gold!

Keep them coming.


Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for Neil

Content

Feedback

Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.

feedback@showmedo.com