#include #include using namespace std; extern "C" void PRINT_HELLO(); extern "C" void PRINT_STRING(const char phrase[], int size); extern "C" void PRINT_INT(int number); extern "C" int DOUBLE_NUMBER(int number); extern "C" int DOUBLE_IN_PLACE(int & number); extern "C" void FILL_ARRAY(int array[], int size, int fillvalue); const int SIZE{10}; int main() { string message{"Hello from C++/from Assembly!\n"}; int number{100}; int values[SIZE]; PRINT_HELLO(); cout << endl; PRINT_STRING(message.c_str(), message.size()); // I needed to flush the stream here or the order was reversed some times. cout << "Assenbly will print this number: " << flush; PRINT_INT(number); cout << endl; number = DOUBLE_NUMBER(number); cout << "After doubling the number is " << number << endl; DOUBLE_IN_PLACE(number); cout << "After doubling the number again : " << number << endl; FILL_ARRAY(values, SIZE, 100); for(int i{0}; i < SIZE; ++i) { cout << values[i] << " "; } cout << endl; return 0; }