creating asm programs
jbwyatt.com

.. emu8086


.. Using Visual C++ to write C++ code

  • You can compile code that will run on your Windows/Intel desktop.
  • Visual C++ Express is a FREE Microsoft product that allows you to create, compile and execute C++ - and ASSEMBLY - programs.
  • Students can get Visual Studio Professional through MSDN AA.

  • Step by Step: Create a C++ program in Visual C++ !

  • The Computer Center has information about campus computer use
  • The "HelpDesk" has student-oriented info at Student Computer Info

  • In Class Demo: Sum every pair of numbers in a file
    // ID: Joseph Wyatt, CIS 163, 10-04-02
    // PURPOSE: Demonstrate files, loops, summing
    /* DESIGN: 
     open file
     read 2 integers from file
     while not at end of file
        add the integers giving the sum
        output sum
        add the sum to the running total
        read 2 integers from file
     end while
     output the running total
    */ close file
    //-------------------------------------------
    #include <iostream>
    #include <iomanip>
    #include <fstream>
    #include <string>
    using namespace std;
    int main()
    {
    const string LINES = "+=========================+\n";
    ifstream dataFile;   // input data - integers
    int num1, num2, sum; // for sum equation
    int total = 0;       // must init - accumulator
    
    // open file & read first 2 integers
    dataFile.open("data.dat");
    dataFile >> num1 >> num2;
    
    // print header (also used as footer)
    cout << LINES << endl;
    
    // while there's data, add nums, add to total, output, read 2 more nums
    while (dataFile != 0)
    {
      sum = num1 + num2;
      total = total + sum;
      cout << left << setw(12) << " The sum of "
           << right << setw(4) << num1 << " & "
           << setw(4) << num2 << " = " << setw(4)
           << sum << endl << endl;
      // read next data
      dataFile >> num1 >> num2;
    }
    // output grand total, close file and end program
    cout << " The grand total is " << total << endl;
    cout << endl << LINES << endl;
    dataFile.close();
    return 0;
    }
    

.. Use Firefox and FireFTP