Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовая работа2 / Debug / Bin / RunTime
.cpp// Compiler Runtime Library and Program Actual Entry Code
// Contains low-level input\output operations for being used in assembler code
extern "C"
{
#include <stdio.h>
#include <string.h>
// Entry code concept. The feature is that actual entry code is located here (main function), but it
// transfer control immediately to assembler (asmentry function)
extern void asmentry();
void main()
{
asmentry();
}
// Reading operations. Nothing specific here, functions recieve pointer parameter, which will contain
// input value, no value is returned by function itself
void read_char( char *Dest )
{
scanf("%c", Dest);
}
void read_int( int* Dest )
{
scanf("%d",Dest);
}
void read_str( char* Dest )
{
gets(Dest);
}
void read_flt( float* Dest)
{
scanf("%f",Dest);
}
// Writing operations. Parameter contains a value to be outputed to screen, strings are outputed through
// pointer to first symbol. No return value is expected yet...
void write_char(char Value)
{
printf("%c", Value);
}
void write_int(int Value)
{
printf("%i", Value);
}
void write_flt(float Value)
{
printf("%g", Value); // print without trailing zeroes
}
void write_str(char* Val)
{
printf("%s",Val);
}
void write_ln()
{
printf("\n");
}
// String operations -------------------
// Copying str to dest
void copy_str(char *dest, char *str)
{
strcpy(dest, str);
}
// Appends str to dest
void concat_str(char *str1, char *str2, char *dest)
{
strcpy(dest, str1);
strcat(dest, str2);
}
} // extern "C"