Laboratory 12 - Example

Multi-module programming (asm+C)

Example 1

Write a C/C++ program which calls the asmConcat function written in assembly language. This function has as parameter a character string read in the C/C++ program, reads another character string using the readString C/C++ function, and accesses an additional character string which is a global variable of the C/C++ program (called stringC ). The function asmConcat builds and returns as a result the string obtained by concatenating the first 10 characters of each of the 3 strings. This string will be printed on the screen.
File C: en_mainConcatenate.c
File asm: en_moduleConcatenate.asm

Example 2

Write a C program that calls the function sumNumbers, written in assembly language. This functions receives as parameters two integer numbers that were read in the C program, computes their sum and returns this value. The C program will display the sum computed by the sumNumbers function.
File C: en_mainSumaNumere.c
File asm: en_modulSumaNumere.asm