x64 Assembly Tutorial 25: Assembly Adjust Brightness Coding

This is coding side of the algorithm we went through last time. My diagrams were a little all over the shop but I think the code is pretty straight forward. The most tricky thing is getting CLR to co-operate with x64 Assembly. There's a few little errors I want to solve that come about when we use CLR and Assembly. I'm using Notepad++ here with my own colour scheme which I find easiest on the eyes. Sorry in advance if this is less clear to read through YouTube. You can download notepad++ from: http://notepad-plus-plus.org/ It comes with Assembly syntax highligting but not x64 Assembly. You can also use the excellent Programmer's Notepad: http://www.pnotepad.org/ Which I find neater and more user friendly, but it just doesn't let me specify a colour scheme as easily. The speed up we get here is very healthy! There are a few things to remember as to why this is happening. First, the algorithm C++ is using is not the same as the Assembler one. Also, it's CLR C++ not native C++. Finally, the C++ compiler is not optimizing (VS2010 complains about native code if we turn on optimizations). Because of these things I've run some tests in native C++ with all optimizations and as close as I can program to the assembly algorithm. I get about 190-200 for the Mars image. It's a lot faster but the Assembly version is still around 15% quicker.