Skip to main content

Posts

Free MASM download

Microsoft has made its x86 assembler available as a free download. The Microsoft Macro Assembler 8.0 (MASM) is a tool that compiles x86 assembly language programs and generates corresponding binaries. Assembly language programs built with MASM can be edited and debugged using Visual C++ 2005 Express Edition. The MASM download can be found at http://www.microsoft.com/downloads/details.aspx?FamilyId=7A1C9DA0-0510-44A2-B042-7EF370530C64&displaylang=en

How to test Visual C++ Compiler & Intellisense

Lambda expressions in new C++0x can be used in many different ways. A lambda can have an empty capture clause. A simple compiler test to test empty capture clause would be something like this in which we will come up a source code related to empty lambda capture clause. The automated test will take these sources and compile them with Visual C++ compiler. If let's say any compilation on a valid usage of lambdas on empty capture clause fails than it is an indication that something is there which either compiler currently not supports or is broken. //Source1: testing empty lambda capture clause int main() { bool even = []( int k){ return k%2 == 0; }(2); return 0; } The above test verifies that we are able to compile correctly the empty capture clause of lambda expressions. But how can we verify that we are generating the correct compiled output? How can we verify that code generated by compiler is correct? We take a further step in the test by look...

Useful Information to make a Release Build using debug information in Visual Studio.

Make my release build a debug build If you are in the process of development and then you notice a crash while testing release build and you don’t know where the crash is taking place, do the following… Enable debugging for your release builds Go to C-C++/Optimizations/ and select Disable(Debug). If you don’t enable this bit you will see weird behavior while debugging. For e.g. addresses show as NULL even for valid objects on stack. By the way this might even be the cause of those crashes so initially you can leave it as it is but watch out for weird behaviors, don’t be surprised. Go to C-C++/Debug Info/ and select Program Database, this will generate a pdb file. If the output for a particular project is of .lib type then this much will suffice. Now for dlls and exes, follow steps 1 - 3. Go to Link tab/section and enable “Generate debug info”, this will add further debugging information to your exe or dll. Will show...

PRACTICE QUIZ

1. Write an m-file program that reads in quiz scores one at a time, calculates the average score, and counts the number of quizzes that score i) less than or equal to 50, ii) over 50 and less than or equal to 75, and iii) over 75 and less than or equal to 100. Your program should do the following: a. Prompt the user “Enter quiz score or 999 to end” b. Increment n_50 , n_75 , or n_100 c. Prompt the user again “Enter quiz score or 999 to end” d. If the user enters 999 for the quiz score, the program should calculate the high score, the low score, and the average score and print out: Quiz average score = uu.uu Highest score = hh Lowest score = ll Number of scores under 50 = xx Number of scores between 50 and 75 = yy Number of scores between 75 and 100=zz and end. (“ xx ,” “ yy ,” and “ zz ” are the actual number of quizzes in each category) f. Have your program plot the score vs. the exam number (first exam: n=1, second exam: n=2, etc.) as below. ...

Directions for using Microsoft Visual C++ 2008 Express Edition:

1. Open the Program Entry Screen: 2. Once at the entry screen, look towards the upper left portion of the screen in the “Recent Project” window. Click on “Create: Project” 3. A window will open with some choices in it. Choose “Win32 Console Application,” as the screen with the black background you usually work in is called the console. Window: Click Here 4. Name the project in the “Name:” text box 5. Click “OK.” This brings up the project wizard. Click “Finish” Name Project here 6. This will bring you to a standard .cpp file with the name “PROJECT_NAME.cpp” if you named it “PROJECT_NAME” 7. Some of the included header files or formats may look strange, but don’t delete them! The computer puts them there to support the Microsoft .NET framework. Just header files like you normally would. a. For example, insert “#include ” (notice no .h) 8. Don’t change the main function format either. Just insert your code into the main function brackets. 9. ...